/* style.css */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc; /* Light blue-gray background */
    color: #334155; /* Dark slate for general text */
}

/* Make header sticky */
header {
    position: sticky; /* Makes the element stick to its position when scrolling */
    top: 0;          /* Sticks to the top edge of the viewport */
    z-index: 50;     /* Ensures the header stays above other content when scrolling */
    background-color: white; /* Ensure background is solid when sticky */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Optional: add shadow for better visual separation */
}


/* Custom button style */
.btn-primary {
    background-image: linear-gradient(to right, #ec4899, #9333ea); /* from-pink-400 to-purple-600 */
    color: white;
    font-weight: 600; /* font-semibold */
    padding: 0.75rem 2rem; /* py-3 px-8 */
    border-radius: 9999px; /* rounded-full */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    transition: all 0.3s ease-in-out;
}

.btn-primary:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* hover:shadow-xl */
    transform: scale(1.05); /* hover:scale-105 */
}

.btn-secondary {
    background-color: white;
    color: #db2777; /* text-pink-600 */
    border: 1px solid #f472b6; /* border border-pink-400 */
    font-weight: 600; /* font-semibold */
    padding: 0.75rem 2rem; /* py-3 px-8 */
    border-radius: 9999px; /* rounded-full */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    transition: all 0.3s ease-in-out;
}

.btn-secondary:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* hover:shadow-lg */
    transform: scale(1.05); /* hover:scale-105 */
}

/* Specific styles for the subscribe button that override btn-secondary */
.btn-secondary.\!bg-white.\!text-purple-600.\!border-none {
    background-color: white !important;
    color: #9333ea !important; /* text-purple-600 */
    border: none !important;
}

/* Mobile navigation specific styles */
#mobile-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-nav.open {
    max-height: 300px; /* Adjust as needed to fit content */
}


/* Image Styling */
.gallery-image {
    width: 150px;
    height: 150px;
    object-fit: cover; /* Ensures images cover the area without distortion */
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gallery-image:hover {
    transform: scale(1.05);
    border-color: #007bff; /* Highlight on hover */
}

/* Modal Background */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* High z-index to be on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.8); /* Darker overlay */
    backdrop-filter: blur(8px); /* Optional: Frosted glass effect */
    -webkit-backdrop-filter: blur(8px); /* For Safari */
    justify-content: center; /* Center modal content horizontally */
    align-items: center; /* Center modal content vertically */
}

/* Modal Content (The White Frame) */
.modal-content {
    background-color: #fefefe;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    position: relative; /* Positioning context for close button */
    animation-name: animatetop;
    animation-duration: 0.4s;

    display: flex;
    flex-direction: column;

    width: 90%;
    max-width: 700px;
    height: auto;
    max-height: 95vh; /* This is the main constraint for the entire modal content */
    /* REMOVED: box-sizing: border-box; */
    padding-top: 0; /* Let internal content manage spacing */
    padding-bottom: 0; /* Let internal content manage spacing */
}

/* Animation for modal appearance - unchanged */
@keyframes animatetop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Close Button */
.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    z-index: 1001;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: background-color 0.2s, color 0.2s;
}

.close-button:hover,
.close-button:focus {
    color: black;
    background-color: rgba(255, 255, 255, 1);
}

/* Navigation Arrows */
.prev-next-button {
    cursor: pointer;
    position: absolute;
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Adjust for perfect centering */
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0,0,0,0.5); /* Semi-transparent background */
    z-index: 1001; /* Ensure arrows are above modal content */
    opacity: 0.8;
}

.prev-next-button:hover {
    background-color: rgba(0,0,0,0.8);
    opacity: 1;
}

/* Position the specific arrows */
#prevButton {
    left: 0;
    border-radius: 0 8px 8px 0;
}

#nextButton {
    right: 0;
    border-radius: 8px 0 0 8px;
}

/* Modal Body (Contains Image and Caption) */
.modal-body {
    flex-grow: 1; /* Allows it to take available space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center image/caption vertically */
    align-items: center;   /* Center image/caption horizontally */
    padding: 20px; /* General padding for content */
    overflow-y: hidden; /* IMPORTANT: Prevent scrolling within modal-body */
    -webkit-overflow-scrolling: touch;
    text-align: center;
}

/* Image inside modal (The actual picture) */
.modal-image {
    max-width: 100%;
    /* Calculate max-height based on viewport and estimated overhead (padding, caption) */
    max-height: calc(95vh - 120px);
    height: auto; /* Maintain aspect ratio */
    display: block;
    margin: 0 auto;
    border-radius: 5px;
    object-fit: contain; /* Ensures the entire image is scaled down to fit */
}

/* Modal Caption */
.modal-caption {
    margin-top: 15px;
    margin-top: 15px;
    font-size: 1.1em;
    color: #000;
    text-align: center;
    padding-bottom: 5px;
    flex-shrink: 0; /* Prevent caption from shrinking too much */
}

/* Cart notification (toast) */
.cart-notification {
    position: fixed;
    top: 6rem; /* Position well below the header (approx 96px) */
    right: 1.5rem; /* Adjusted right spacing for better visual balance */
    background-color: #22c55e; /* green-500 from Tailwind */
    color: white;
    padding: 1rem 1.5rem; /* Slightly larger padding for better touch target/readability */
    border-radius: 0.75rem; /* More rounded corners for a modern look */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* Softer, larger shadow */
    font-weight: 500; /* Medium font weight */
    text-align: center;
    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Ensures it's not clickable when hidden */
    transform: translateY(20px); /* Starts slightly below final position for subtle slide-in */
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0.4s ease-out; /* Smoother transitions */
    z-index: 1001; /* Higher than cart modal (1000) so it appears above */
}

.cart-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* --- Cart Modal Specific Styling --- */
#cartModal.modal .modal-content {
    /* Make cart modal appear as a sidebar from the right */
    position: fixed;
    right: 0;
    top: 0;
    height: 100%; /* Full height */
    width: 100%; /* Default to full width on smaller screens */
    max-width: 420px; /* Max width for larger screens (e.g., tablet/desktop) */
    border-radius: 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

/* Adjust close button position for sidebar */
#cartModal .close-button {
    top: 1.5rem;
    right: 1.5rem;
}

/* Ensure modal-body inside cart modal can scroll and aligns content correctly */
#cartModal .modal-body {
    margin-top: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Enable vertical scrolling */
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    padding-bottom: 2rem; /* Add padding to the bottom of the scrollable area */
}

/* New animation for sidebar slide-in */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0.8;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* --- Cart Item Styling (Clean & Modern) --- */
.cart-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem; /* Slightly reduced vertical padding */
    background-color: #f9fafb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 0.5rem; /* Slightly reduced margin between items */
    transition: all 0.2s ease-in-out;
    border: 1px solid #eee;
}

.cart-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* .cart-item-image is not currently in HTML, so its rules are moot unless image is added */
/*
.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
    flex-shrink: 0;
}
*/

.cart-item-info {
    flex-grow: 1;
    text-align: left;
    min-width: 0; /* Allows content to shrink beyond intrinsic size */
}

.cart-item-name {
    font-weight: 600;
    color: #4c1d95;
    font-size: 1.05rem; /* Slightly smaller font for names */
    margin-bottom: 0.15rem; /* Reduced margin */
    white-space: normal; /* Allow text to wrap */
    word-break: break-word; /* Ensure long words break */
    overflow-wrap: break-word; /* Alternative for older browsers */
}

.cart-item-price {
    font-size: 0.9rem; /* Slightly smaller price text */
    color: #6b7280;
}

.cart-item-quantity-control {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Slightly reduced gap */
    margin-left: 0.75rem; /* Slightly reduced margin */
    flex-shrink: 0;
}

.cart-item-quantity-control button {
    background-color: #a78bfa;
    color: white;
    width: 30px; /* Slightly smaller buttons */
    height: 30px; /* Slightly smaller buttons */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem; /* Slightly smaller font for +/- */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
}

.cart-item-quantity-control button:hover {
    background-color: #8b5cf6;
    transform: scale(1.05);
}

.cart-item-quantity {
    font-weight: 700;
    color: #374151;
    min-width: 25px; /* Ensure consistent width, slightly smaller */
    text-align: center;
    font-size: 1rem; /* Slightly smaller quantity font */
}

.remove-item-button {
    background-color: #ef4444;
    color: white;
    padding: 0.4rem 0.6rem; /* Slightly reduced padding */
    border-radius: 0.375rem;
    font-size: 0.8rem; /* Slightly smaller font */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-left: 0.75rem; /* Slightly reduced margin */
    border: none;
    flex-shrink: 0;
}

.remove-item-button:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}


section[id] { /* Apply to all sections that have an ID (which are your scroll targets) */
    scroll-margin-top: 5rem; /* Adjust this value based on your header's height */
    /* If your header is exactly 64px (h-16), 4rem (64px) might be perfect.
       5rem (80px) provides a bit more padding. Adjust as needed. */
}
