/* Products main section */
.products-main {
    padding-top: 4rem;
    min-height: 100vh;
    background-color: var(--background-light);
}

.products-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    padding-bottom: 20px;
}

.products-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.products-header h1 {
    color: var(--primary-color, #2c3e50);
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.products-header p {
    color: var(--text-color, #666);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* Filter section */
.filter-section {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    color: var(--primary-color);
    background: rgba(33, 84, 173, 0.05); /* very light primary hover */
}

.filter-btn.active {
    background: var(--primary-color, #2c3e50);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 84, 173, 0.3);
}

.filter-select {
    display: none;
    width: 100%;
    max-width: 300px;
}

#podklasaSelect {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-color);
}

#podklasaSelect:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 5rem;
    padding: 10px; /* Space for shadow */
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -15px rgba(33, 84, 173, 0.2);
    border-color: rgba(33, 84, 173, 0.1);
}

.product-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    border-bottom: 1px solid #f9f9f9;
}

.product-image img {
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    transition: transform 0.5s ease;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.05));
    display: block !important;
    margin: 0 auto !important;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 20px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
}

.product-info h3 {
    color: var(--text-color, #333);
    font-size: 1.15rem;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: 700;
    transition: color 0.3s ease;
}

.product-card:hover .product-info h3 {
    color: var(--primary-color);
}

.product-packaging {
    color: var(--text-light, #888);
    font-size: 0.9rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker backdrop */
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    position: relative;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    width: 100%;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.close {
    color: #333;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    background: #f0f2f5;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
}

.close:hover {
    color: white;
    background: #e74c3c;
    transform: rotate(90deg);
}

.modal-image {
    width: 100%;
    height: 100%; /* Fill the column */
    min-height: 400px;
    max-height: 600px; /* Ograničavamo maksimalnu visinu slike da ne "lomi" modal */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
    display: block !important;
    margin: 0 auto !important;
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-info h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fcfcfc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.detail-row:first-child {
    padding-top: 5px;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 5px;
}

.detail-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary, linear-gradient(135deg, #2154ad 0%, #103275 100%));
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-top: 5rem;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 600px;
        margin: 5% auto;
        width: 95%; /* Malo šire na manjim ekranima */
    }
    
    .modal-image {
        height: auto;
        min-height: 300px;
        max-height: 400px;
        padding: 20px;
    }
    
    .modal-info {
        padding: 25px;
    }

    .modal-info h3 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .filter-buttons {
        gap: 10px;
        border-radius: 12px;
    }
}

@media (max-width: 768px) {
    .filter-buttons {
        display: none;
    }
    .filter-select {
        display: block;
    }
    .products-header h1 {
        font-size: 2.2rem;
    }
    .product-image {
        height: 200px;
    }
}

