/* Background Image */
.bg-image {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%),
                url('../images/image1.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Fallback gradient if image doesn't load */
.bg-image::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: -2;
}

/* Glass morphism styles */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-card-inner {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.product-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.product-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px 0 rgba(31, 38, 135, 0.3);
}

/* Product image styling */
.product-image-container {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-image-container img {
    transition: transform 0.3s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

/* Category badge */
.category-badge {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Button styles with animations */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover:before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.7);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px 0 rgba(240, 147, 251, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-secondary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-secondary:hover:before {
    left: 100%;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(240, 147, 251, 0.6);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Quantity control buttons */
.quantity-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Variant select dropdown */
.variant-select {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.variant-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.variant-select:focus {
    background: rgba(255, 255, 255, 0.2);
}

.variant-select option {
    background: rgba(102, 126, 234, 0.95);
    color: white;
}

.quantity-btn:active {
    transform: scale(0.95);
}

/* Info button next to product name */
.info-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 700;
    line-height: 1;
    transition: all 0.2s ease;
}
.info-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}
.info-btn:active {
    transform: scale(0.95);
}

/* Header filter buttons (Voer/Koekjes) */
.filter-btn {
    /* slightly bigger than default */
    padding: 0.6rem 0.9rem; /* ~py-2.5 px-3.5 */
    font-weight: 700;
}
.filter-btn.active {
    background: rgba(34, 197, 94, 0.25); /* green-500 at low opacity for glassy look */
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3) inset;
}
/* hover state even when active */
.filter-btn.active:hover {
    background: rgba(34, 197, 94, 0.35);
}
/* Inactive (filtering out) state - red */
.filter-btn.inactive {
    background: rgba(239, 68, 68, 0.25); /* red-500 */
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) inset;
}
.filter-btn.inactive:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* Product info modal tweaks */
#productInfoModal .glass-card {
    max-height: 90vh;
    overflow: auto;
    /* removed min-height to allow natural sizing */
}

/* Glassy button utility for Info */
.btn-glass {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.28); }
.btn-glass:active { transform: translateY(0.5px) scale(0.98); }

/* Product info content layout: image left, text right */
.product-info-content {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: stretch; /* make text box match image height */
    gap: 16px;
}
.info-image {
    width: 150px;
    display: flex;
}
@media (min-width: 640px) { /* sm */
    .info-image { width: 220px; }
}
.image-frame {
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}
.image-frame img {
    display: block;
    width: 100%;
        height: 100%;
        object-fit: cover;
}
.image-frame { aspect-ratio: 3 / 4; } /* portrait to add more height without increasing width */

@media (max-width: 400px) {
    /* On very small screens, allow natural aspect to avoid pushing content off screen */
    .image-frame { aspect-ratio: auto; }
}
.info-text-box { 
    min-width: 0; 
    display: flex; 
    flex-direction: column;
    height: 100%; /* match image height */
}
.info-details {
    overflow: auto;
    padding-right: 4px; /* avoid scrollbar overlay */
}
.info-footer {
    margin-top: auto; /* push footer to bottom to fill space */
}

/* Bottom extra text section spacing within modal */
.info-bottom { 
    /* minimal spacing to almost connect with text box above */
    margin-top: 4px;
}

/* Mobile-only red close button for product info modal */
.info-close-mobile {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: rgba(239, 68, 68, 0.95); /* red-500 */
    color: #fff;
    font-weight: 800;
    line-height: 1;
    display: none; /* hidden by default, shown on very small screens */
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
    z-index: 10;
}
.info-close-mobile:hover { filter: brightness(1.05); }
.info-close-mobile:active { transform: scale(0.98); }

/* Larger typography inside info modal */
#infoTitle { font-size: 1.375rem; } /* ~22px base, larger than sm text-xl */
@media (min-width: 640px) {
    #infoTitle { font-size: 1.625rem; } /* ~26px */
}
#infoText { font-size: 0.975rem; line-height: 1.7; }
@media (min-width: 640px) {
    #infoText { font-size: 1.05rem; }
}

/* Stack only on very narrow screens */
@media (max-width: 600px) {
    .product-info-content {
        grid-template-columns: 1fr;
    }
    .info-image { width: 100%; height: auto; }
    .image-frame { height: auto; }
    /* Show mobile close button and hide default corner close to avoid overlap */
    #closeProductInfo { display: none !important; }
    .info-close-mobile { display: inline-flex; }
}

/* Input field enhancements */
input:focus {
    transform: scale(1.01);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Mobile-first responsive adjustments */
@media (max-width: 640px) {
    .glass-card {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    .product-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Ensure text is readable on mobile */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
}

/* Security indicator for customer code input */
#modalCustomerCode.invalid {
    border-color: rgba(239, 68, 68, 0.8);
    animation: shake 0.3s;
}

#modalCustomerCode.valid {
    border-color: rgba(34, 197, 94, 0.8);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
