/* CSS Reset & Variables */
:root {
    --primary-color: #fce4ec;
    /* Soft Pink */
    --secondary-color: #ffffff;
    --accent-color: #d81b60;
    /* Deep Pink */
    --link-color: #ad1457;
    --text-color: #4a4a4a;
    --light-gray: #e0e0e0;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--primary-color);
    color: var(--text-color);
}

/* Hero Section */
.hero-section {
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-bottom: 4px solid var(--accent-color);
}

.hero-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}



@media (max-width: 480px) {

    /* Removed empty rule */
    .hero-section {
        margin-bottom: 10px;
    }
}

#app {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Product Card */
.product {
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.product-images {
    position: relative;
    height: 300px;
    overflow: hidden;
    background-color: #eee;
}

.product-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-images:hover img {
    transform: scale(1.05);
    /* Subtle zoom effect */
}

/* Slideshow */
.slideshow-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    width: 100%;
    height: 100%;
    display: none;
}

.slide.active {
    display: block;
    animation: fade 0.5s;
}

@keyframes fade {
    from {
        opacity: 0.8
    }

    to {
        opacity: 1
    }
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    box-sizing: border-box;
    transform: translateY(-50%);
    pointer-events: none;
    /* Let clicks pass through to image if not on button */
}

.nav-btn {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    color: var(--accent-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color 0.3s, color 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Product Details */
.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-info h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: #222;
}

.product-info .desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
    flex-grow: 1;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 15px;
}

/* Interaction Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f9f9f9;
    border-radius: 30px;
    padding: 5px 10px;
}

.qty-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.qty-btn:hover {
    color: var(--accent-color);
}

.qty-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

/* Remove Arrows from Number Input */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.add-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-btn:hover {
    background-color: #c2185b;
    transform: scale(1.02);
}

.add-btn:active {
    transform: scale(0.98);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    line-height: 1;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.close-modal:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.modal-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 20px;
    max-width: 80%;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 20px;
    cursor: pointer;
    font-size: 24px;
    transition: 0.3s;
    user-select: none;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Side Cart */
.cart-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(216, 27, 96, 0.4);
    z-index: 1600;
    /* Higher than cart sidebar (1500)? No, sidebar should be on top. Sidebar is 1500. Let's check sidebar z-index. Sidebar is 1500. Button should be lower than sidebar if sidebar covers it, OR higher if it toggles. Usually sidebar covers everything. Let's keep it high but check sidebar interaction. */
    /* Sidebar is z-index 1500. If we want button to be visible always? No, when cart is open, maybe we don't need it or it pushes content. 
       Let's keep z-index 1000 or similar. Sidebar is 1500. 
       Wait, if sidebar slides in from right, it might cover the button if button is bottom-right. That's fine.
    */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.cart-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(216, 27, 96, 0.6);
}

.cart-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.3);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: white;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.side-cart {
    position: fixed;
    top: 0;
    right: -400px;
    width: 360px;
    height: 100%;
    background-color: var(--secondary-color);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.side-cart.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    margin: 0 0 5px;
    font-size: 0.95rem;
}

.cart-item-price {
    font-size: 0.9rem;
    color: #888;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.remove-btn {
    background: none;
    border: none;
    color: #ff4d4d;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.remove-btn:hover {
    text-decoration: underline;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background-color: #fafafa;
}

.cart-total-line {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.checkout-btn {
    width: 100%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.checkout-btn:hover {
    background-color: #b0124a;
}

/* --- Mobile Responsiveness --- */

/* Tablet & Mobile (max-width: 768px) */
@media (max-width: 768px) {
    #app {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
        padding: 20px;
    }

    .side-cart {
        width: 100%;
        right: -100%;
    }

    .product-images {
        height: 250px;
        /* Reference existing height: 300px */
    }

    .cart-toggle-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    #app {
        grid-template-columns: 1fr;
        /* Single column */
        gap: 20px;
        padding: 15px;
    }

    .product-info h3 {
        font-size: 1.1rem;
    }

    .nav-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    /* Optimize Modal for mobile */
    .modal-content-wrapper {
        align-items: center;
    }

    .modal-img {
        max-width: 95%;
        max-height: 80vh;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }

    .modal-nav-btn {
        padding: 15px;
        font-size: 20px;
    }
}

/* --- Notification System --- */

.cart-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1400;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-backdrop.show {
    opacity: 1;
}

@media (max-width: 768px) {
    .cart-backdrop.active {
        display: block;
    }
}

/* Notification Container */
#notification-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
    /* Let clicks pass through if not on card */
}

/* Notification Card */
.notification-card {
    background: #1a1a2e;
    color: #f5f5f5;
    padding: 15px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border-left: 5px solid #ccc;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.notification-card.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-card.hiding {
    opacity: 0;
    transform: translateY(-20px);
}

/* Variants */
.notification-card.success {
    border-left-color: #2e7d32;
}

.notification-card.error {
    border-left-color: #ff5252;
    background-color: #2d1f1f;
}

.notification-card.warning {
    border-left-color: #f9a825;
}

.notification-card.info {
    border-left-color: #0277bd;
}

/* Icons */
.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.notification-card.success .notification-icon {
    color: #2e7d32;
}

.notification-card.error .notification-icon {
    color: #d32f2f;
}

.notification-card.warning .notification-icon {
    color: #f9a825;
}

.notification-card.info .notification-icon {
    color: #0277bd;
}

/* Content */
.notification-content {
    flex-grow: 1;
    color: #f5f5f5;
    line-height: 1.4;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 2px;
    display: block;
    color: #fff;
}

/* Close Button */
.notification-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    transition: color 0.2s;
}

.notification-close:hover {
    color: #fff;
}

/* Footer */
.site-footer {
    background-color: #d81b60;
    color: #fff;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}

.site-footer a {
    color: #fff;
    text-decoration: underline;
}

.site-footer a:hover {
    text-decoration: none;
}