:root {
    /* Primary colors */
    --popup-primary-color: #2d3436;
    --popup-secondary-color: #636e72;
    --popup-accent: linear-gradient(135deg, #74ebd5, #9face6);
    
    /* Backgrounds */
    --popup-background: #ffffff;
    --popup-bg-blur: 4px;

    /* Border and shadows */
    --border-color: rgba(45, 52, 54, 0.1);
    --shadow: 0 15px 40px rgba(45, 52, 54, 0.15);

    /* Transition and animation */
    --transition-fast: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    --transition-smooth: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    --modal-fade-in: 0.3s ease-out;

    /* Sizing and spacing */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --popup-spacing: clamp(1rem, 2vw, 2rem);
    --popup-modal-width: min(90%, 800px);
    --popup-close-size: 40px;
}

body {
    background-color: var(--popup-background);
    color: var(--popup-primary-color);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Ensure padding and border don't affect element size */
    -webkit-font-smoothing: antialiased; /* Optimizes font rendering */
}

.product-card {
    background: var(--popup-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    z-index: 1000;
    padding: 2rem;
    max-width: 800px;
    margin: 2rem auto;
    transition: var(--transition-smooth);
    will-change: transform, opacity;
}

.product-image {
    height: 350px;
    width: 100%;
    border-radius: var(--radius-lg);
    background: #f1f2f6 url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><rect width='40' height='40' fill='%23e9ecef'/></svg>") center/cover no-repeat;
    background-size: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Soft shadow for a modern feel */
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
    will-change: transform, box-shadow, background;
    position: relative;
}

.product-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2)); /* Gradient overlay for a dramatic effect */
    border-radius: var(--radius-lg);
    transition: background 0.3s ease;
}

.product-image:hover {
    transform: scale(1.1); /* Slight zoom effect on hover */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow for emphasis */
}

.product-image:hover::before {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.3)); /* Darker overlay on hover */
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    transition: opacity 0.3s ease;
}

@media (max-width: 1200px) {
    .product-image {
        height: 300px; /* Smaller image size for larger tablets and smaller desktop screens */
    }
}

@media (max-width: 1024px) {
    .product-image {
        height: 250px; /* Reduce size further for tablets */
        border-radius: var(--radius-md); /* Smaller border radius on tablets */
    }
}

@media (max-width: 768px) {
    .product-image {
        height: 200px; /* Smaller image size for mobile devices */
        border-radius: var(--radius-sm); /* Even smaller border radius on mobile devices */
    }
}

@media (max-width: 480px) {
    .product-image {
        height: 180px; /* Further reduce size for small phones */
        border-radius: 10px; /* Even smaller border radius for a compact look */
    }

    .product-image::before {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1)); /* Lighter overlay for small screens */
    }
}

/* Lightbox modal styles */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1100;
    padding: 1rem;
    transition: opacity 0.3s ease-in-out;
    overflow-y: auto;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Show lightbox when it's active */
.lightbox.show {
    display: flex;
}

/* Close button for lightbox */
.lightbox .close-lightbox {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lightbox .close-lightbox:hover {
    background: rgba(0, 0, 0, 0.8);
}



.size-option {
    flex: 1;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--popup-background);
    color: var(--popup-secondary-color);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.size-option.active {
    background: var(--popup-accent);
    color: #fff;
    border-color: transparent;
    transform: scale(1.08);
}

.btn-quantity {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--popup-background);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-quantity:hover,
.btn-quantity:focus {
    border-color: var(--popup-primary-color);
    outline: none;
}

.quantity-input {
    width: 90px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.btn-accent {
    background: var(--popup-accent);
    border: none;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-accent:hover,
.btn-accent:focus {
    opacity: 0.95;
    transform: translateY(-3px);
    outline: none;
}

.text-accent {
    background: var(--popup-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
}

.price-display span {
    font-size: 1rem;
}

#unitPrice {
    font-size: 1.5rem;
}

#totalPrice {
    font-size: 2rem;
    font-weight: bold;
}

.product-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(var(--popup-bg-blur));
    z-index: 1050;
    overflow: hidden;
    transition: opacity var(--modal-fade-in);
    will-change: opacity;
}

.product-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal-content {
    background-color: var(--popup-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--popup-spacing);
    width: var(--popup-modal-width);
    max-height: 90vh;
    overflow-y: scroll;
    scrollbar-width: none;
    animation: modalFadeIn var(--modal-fade-in);
    position: relative;
}

.product-modal-content::-webkit-scrollbar {
    display: none;
}

.close-modal {
    position: absolute;
    z-index: 1100;
    inset: 1rem;
    width: var(--popup-close-size);
    height: var(--popup-close-size);
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.close-modal:hover,
.close-modal:focus-visible {
    background: rgba(0, 0, 0, 0.75);
    outline: none;
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 768px) {
    /* Adjust modal for smaller screens */
    .product-modal-content {
        max-height: 80vh;
        border-radius: var(--radius-sm);  /* Ensure rounded borders on smaller screens */
        box-shadow: none;
        padding: 1.5rem;
        width: 95%; /* Maximize width on smaller screens */
        margin: 0 auto;
    }

    /* Adjust close modal button size for small screens */
    .close-modal {
        inset: 0.75rem;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    /* Ensure product card also maintains roundness */
    .product-card {
        border-radius: var(--radius-sm);
    }
}

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


