@media only screen and (min-width: 780px) and (max-width: 820px) and (min-height: 1200px) and (max-height: 1300px) {
  .modal-image {
    max-width: 500px;
    max-height: 320px !important;
    height: auto;
    object-fit: contain;
  }
}
.modal-image-description {
    font-size: 1rem;
    color: #444;
    margin-top: 0.7em;
    word-break: break-word;
    white-space: pre-line;
    line-height: 1.6;
    width: 100%;
    min-height: 2em;
    max-height: 320px;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #c7d6e6 #f8fcff;
}
/* Modal image flex layout and description styles */
.modal-content-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    width: 100%;
    min-height: 320px;
}
/* Responsive layout for iPad and below */
@media (max-width: 1024px) {
  .modal-content-flex {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }
  .modal-image {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 90%;
    max-width: 500px;
    max-height: 320px !important;
    height: auto;
    object-fit: contain;
  }
  .modal-image {
    max-width: 500px;
    max-height: 320px !important;
    height: auto;
    object-fit: contain;
  }
  .modal-description-section {
    margin-left: 0;
    margin-top: 10em;
    align-items: center;
    justify-content: flex-start;
    width: 90%;
    max-width: 400px;
    min-width: unset;
    text-align: justify;
    box-sizing: border-box;
    text-align: center;
  }
}

.modal-description-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    min-width: 260px;
    max-width: 300px;
    min-height: 350px;
    max-height: 350px;
    background: #f8fcff;
    border-radius: 14px;
    box-shadow: 0 8px 32px 0 rgba(60, 80, 120, 0.18), 0 1.5px 8px rgba(0,0,0,0.07);
    padding: 1.1rem 1.5rem;
    overflow-y: auto;
    text-align: justify;
    box-sizing: border-box;
    margin-left: 32px;
    line-height: 1.5;
}

@media (max-width: 900px) {
  .modal-content-flex {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }
  .modal-image {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    max-height: 350px !important;
    height: auto;
    object-fit: contain;
  }
  .modal-description-section {
    margin-left: 0 !important;
    margin-top: 24px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 400px;
    min-width: unset;
    text-align: justify;
    min-height: 150px;
    max-height: 150px;
  }
}

/* Increase modal-description-section height for all iPhone sizes */
@media only screen and (max-width: 400px) {
  .modal-description-section {
    min-height: 180px !important;
    max-height: 180px !important;
    height: 180px !important;
  }
}

/* Increase modal-description-section height for all iPhone sizes */
@media only screen and (min-width: 410px) {
  .modal-description-section {
    min-height: 250px !important;
    max-height: 250px !important;
    height: 250px !important;
  }
}


@media only screen and (min-width: 700px) and (max-width: 1024px) {
  .modal-description-section {
    min-height: 300px !important;
    max-height: 300px !important;
    height: 300px !important;
  }
}

.modal-image-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: #222;
    margin: 0;
    word-break: break-word;
    white-space: pre-line;
    line-height: 1.5;
    width: 100%;
    min-height: 2em;
    max-height: 320px;
    background: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    height: auto;
    box-sizing: border-box;
    transition: height 0.3s ease, background 0.3s;
    scrollbar-width: thin;
    scrollbar-color: #c7d6e6 #f8fcff;
}
/* Dropdown fade indicators for product categories */
/* Even tighter spacing for iPhone SE and similar small screens */
/* Reduce image height and margin for 412x883px screens (e.g., some Android devices) */
/* Reduce image height and margin for all common phone and iPad sizes */
@media only screen and (max-width: 900px) {
  .modal-image {
    max-height: 120px !important;
    height: auto;
    object-fit: contain;
  }
  .modal-content-flex {
    gap: 0.1rem !important;
  }
  .modal-description-section {
    margin-top: 0.1em !important;
  }
}
@media only screen and (max-width: 430px) and (min-width: 390px) and (max-height: 900px) and (min-height: 800px) {
  .modal-image {
    max-height: 350px !important;
    height: auto;
    object-fit: contain;
  }
  .modal-content-flex {
    gap: 0.1rem !important;
  }
  .modal-description-section {
    margin-top: 0.1em !important;
  }
}
@media only screen and (max-width: 375px) {
  .modal-content-flex {
    gap: 0.05rem !important;
  }
  .modal-description-section {
    margin-top: 0.05em !important;
  }
}
/* Professional shadow fade indicators for dropdown */
.dropdown-fade-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s;
}
.dropdown-fade-indicator.top-indicator {
  top: 0;
  background: linear-gradient(to bottom, rgba(30, 30, 30, 0.65) 0%, rgba(30, 30, 30, 0.32) 60%, rgba(30, 30, 30, 0));
}
.dropdown-fade-indicator.bottom-indicator {
  bottom: 0;
  background: linear-gradient(to top, rgba(30, 30, 30, 0.65) 0%, rgba(30, 30, 30, 0.32) 60%, rgba(30, 30, 30, 0));
}
/* Old conflicting styles - disabled */
/* 
#products-menu {
  position: relative;
  overflow: visible;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  border-radius: 8px;
}
*/
#products-menu-list {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

/* Remove conflicting dropdown menu item styles */
#products-menu-list button, .category-btn {
  /* Remove these old styles that conflict with our new unified design */
  background: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Clean up old conflicting menu styles */
/* Smooth crossfade for product animation images */
.product-animation-flex {
  transition: opacity 0.7s ease-out;
  opacity: 1;
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.product-animation-image {
  opacity: 0;
  transition: opacity 0.7s ease-out;
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Prevent container expansion during animations */
.product-animation-container.animating-out {
    height: auto !important;
    max-height: min(80vh, 600px) !important;
    overflow: hidden !important;
}

/* Large screens - adjust animating-out container restrictions */
@media (min-width: 1200px) {
    .product-animation-container.animating-out {
        max-height: min(85vh, 700px) !important;
    }
}

@media (min-width: 1400px) {
    .product-animation-container.animating-out {
        max-height: min(85vh, 800px) !important;
    }
}

@media (min-width: 1600px) {
    .product-animation-container.animating-out {
        max-height: min(90vh, 900px) !important;
    }
}

@media (min-width: 1920px) {
    .product-animation-container.animating-out {
        max-height: min(90vh, 1000px) !important;
    }
}

@media (min-width: 2560px) {
    .product-animation-container.animating-out {
        max-height: min(85vh, 1100px) !important;
    }
}

.hero-bg-finished .product-animation-container,
.hero-bg-finished .product-animation-container::before {
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
}
.hero-bg-finished .product-animation-container:not(:empty) {
    box-shadow: none !important;
}
/* Global Styles */
:root {
    --primary-color: #c5a164;
    --secondary-color: #0f1f2c;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --gray: #e0e0e0;
    --dark-gray: #888;
    --black: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --fluid-typography-ratio: 0.5vw;

    /* Enhanced Animation CSS Variables */
    --animation-duration: 800ms;
    --animation-delay: 0ms;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-distance: 50px;
    --blur-amount: 3px;
    --scale-factor: 0.9;
    --rotation-angle: 5deg;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

body {
    background-color: var(--white);
    color: var(--black);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100vw;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button {
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background-color: var(--secondary-color);
    color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: auto;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 45px;
    margin-right: 10px;
}

.logo-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.search-container {
    flex-grow: 0;
    margin: 0 1.5rem;
    width: 200px; /* Reduced width for compactness */
}

#search-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--gray);
    border-radius: 4px;
    font-size: 0.85rem;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn-container {
    position: relative;
}

.nav-btn {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
}

.nav-btn:hover {
    background-color: #d6b478;
    transform: scale(1.05);
}

#home-btn {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

#home-btn:hover {
    background-color: #1e3545;
    transform: scale(1.05);
}

.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
}

.cart-btn:hover {
    background-color: #d6b478;
    transform: scale(1.05);
}

.cart-btn img {
    width: 24px;
    height: 24px;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Products Menu Styles - Unified rectangular dropdown */
#products-menu {
    position: absolute;
    top: 100%;
    left: 0;
    /* Exact same solid color as the button for seamless connection */
    background: var(--primary-color);
    border-radius: 0 0 16px 16px;
    padding: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    transform-origin: top center;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    width: 100%;
    margin-top: -1px; /* Perfect overlap to hide seam */
    
    /* Remove all borders and shadows to eliminate edge effects */
    border: none !important;
    box-shadow: none !important;
    
    /* Enhanced scroll functionality */
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 31, 44, 0.3) transparent;
    
    /* Modern animation states */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scaleY(0.8);
    pointer-events: none;
}

/* Show state with smooth animation */
#products-menu:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scaleY(1);
    pointer-events: all;
    animation: modernDropdownEnter 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Modern dropdown entrance animation */
@keyframes modernDropdownEnter {
    0% {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.8);
    }
    60% {
        opacity: 0.8;
        transform: translateY(5px) scaleY(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

/* Modern custom scrollbar for webkit browsers */
#products-menu::-webkit-scrollbar {
    width: 6px;
}

#products-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

#products-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, rgba(15, 31, 44, 0.4), rgba(15, 31, 44, 0.6));
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#products-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, rgba(15, 31, 44, 0.6), rgba(15, 31, 44, 0.8));
    transform: scaleY(1.1);
}

/* Modern scroll fade indicators - disabled for unified color */
#products-menu::before,
#products-menu::after {
    display: none; /* Temporarily disable to ensure perfect color match */
}

#products-menu.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-20px) scaleY(0.8) !important;
    pointer-events: none !important;
    animation: modernDropdownExit 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Exit animation for smoother hiding */
@keyframes modernDropdownExit {
    0% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.8);
    }
}

/* Full-width category buttons as sub-rectangles */
.category-btn {
    /* Full width expansion from left to right */
    width: 100%;
    margin: 0;
    padding: 0.85rem 1.2rem;
    border: none;
    border-radius: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.02) 50%, 
        rgba(15, 31, 44, 0.02) 100%);
    color: var(--secondary-color);
    text-align: left;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
    min-height: 48px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-sizing: border-box;
    
    /* Visible border separation */
    border-bottom: 1px solid rgba(15, 31, 44, 0.3);
}

/* First button - clean top */
.category-btn:first-child {
    border-radius: 0;
    border-top: 1px solid rgba(15, 31, 44, 0.3);
}

/* Last button - clean bottom with rounded corners */
.category-btn:last-child {
    border-radius: 0 0 16px 16px;
    border-bottom: none;
}

/* Left-to-right expanding hover effect */
.category-btn::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.25) 50%, 
        rgba(255, 255, 255, 0.15) 100%);
    transition: left 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: -1;
}

/* Unified hover background overlay */
.category-btn::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(15, 31, 44, 0.05) 100%);
    transition: width 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: -1;
}

/* Modern hover effects - unified rectangular approach */
.category-btn:hover {
    color: var(--secondary-color);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.12) 50%, 
        rgba(15, 31, 44, 0.05) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    /* Remove individual transforms for unified look */
    transform: none;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn:hover::after {
    width: 100%;
}

/* Unified active state */
.category-btn:active {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(15, 31, 44, 0.08) 100%);
    box-shadow: 
        inset 0 2px 4px rgba(15, 31, 44, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.1s ease;
}

/* Staggered animation for category buttons */
.category-btn:nth-child(1) { animation-delay: 0.05s; }
.category-btn:nth-child(2) { animation-delay: 0.1s; }
.category-btn:nth-child(3) { animation-delay: 0.15s; }
.category-btn:nth-child(4) { animation-delay: 0.2s; }
.category-btn:nth-child(5) { animation-delay: 0.25s; }
.category-btn:nth-child(6) { animation-delay: 0.3s; }
.category-btn:nth-child(7) { animation-delay: 0.35s; }
.category-btn:nth-child(8) { animation-delay: 0.4s; }

/* Animation for individual category buttons when dropdown opens */
#products-menu:not(.hidden) .category-btn {
    animation: categoryButtonSlideIn 0.5s cubic-bezier(0.4, 0.0, 0.2, 1) both;
}

@keyframes categoryButtonSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

/* Modern products button to seamlessly connect with dropdown */
#products-btn.nav-btn {
    /* Override all inherited .nav-btn properties */
    min-width: 180px;
    width: 100%;
    padding: 0.8rem 1.2rem;
    border-radius: 12px 12px 0 0 !important; /* Force override */
    position: relative;
    z-index: 101;
    
    /* Exact same solid background as dropdown for perfect match */
    background: var(--primary-color) !important; /* Force override */
    border: none !important; /* Remove all borders to eliminate edges */
    
    /* Remove all shadows that could create edges */
    box-shadow: none !important;
    
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    
    /* Override any inherited transform or scale */
    transform: none !important;
    
    /* Ensure consistent typography */
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

#products-btn.nav-btn:hover {
    /* Override inherited hover styles */
    background: var(--primary-color) !important; /* Keep same color on hover for now */
    transform: none !important; /* Disable hover transforms that might cause misalignment */
    box-shadow: none !important; /* Remove hover shadows */
    border: none !important; /* Ensure no borders on hover */
}

/* When dropdown is open, create visual separation from products button */
#products-btn.nav-btn:not(.hidden) + #products-menu:not(.hidden) {
    /* Add separator line at top of dropdown */
    border-top: 2px solid rgba(15, 31, 44, 0.4);
    margin-top: 0; /* Remove seamless connection */
}

/* Touch device optimizations for unified dropdown */
@media (hover: none) and (pointer: coarse) {
    .category-btn {
        min-height: 52px; /* Larger touch targets */
        padding: 1rem 1.2rem;
    }
    
    .category-btn:hover {
        transform: none; /* Disable hover transforms on touch */
    }
    
    .category-btn:active {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.3) 0%, 
            rgba(255, 255, 255, 0.2) 50%, 
            rgba(15, 31, 44, 0.1) 100%);
    }
}

/* Responsive adjustments for unified rectangular design */
@media (max-width: 768px) {
    #products-menu {
        max-height: 280px;
        border-radius: 0 0 12px 12px;
    }
    
    .category-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        min-height: 46px;
        width: 100%; /* Ensure full width */
        margin: 0; /* No margins for unified design */
        border-radius: 0; /* Keep rectangular */
    }
    
    .category-btn:last-child {
        border-radius: 0 0 12px 12px;
    }
}

/* Small mobile screens */
@media (max-width: 576px) {
    #products-menu {
        max-height: 260px;
        border-radius: 0 0 11px 11px;
        padding: 0;
    }
    
    .category-btn {
        padding: 0.75rem 0.9rem;
        font-size: 0.87rem;
        min-height: 45px;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .category-btn:last-child {
        border-radius: 0 0 11px 11px;
    }
    
    #products-btn.nav-btn {
        border-radius: 11px 11px 0 0;
        padding: 0.75rem 1.1rem;
        font-size: 0.9rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #products-menu {
        max-height: 240px;
        padding: 0;
        border-radius: 0 0 10px 10px;
    }
    
    .category-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
        min-height: 44px;
        width: 100%; /* Ensure full width on small screens */
        margin: 0; /* Remove any margins */
        border-radius: 0; /* Keep rectangular sub-elements */
    }
    
    .category-btn:last-child {
        border-radius: 0 0 10px 10px;
    }
    
    /* Adjust products button for small screens */
    #products-btn.nav-btn {
        border-radius: 10px 10px 0 0;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}

/* iPhone SE and very small screens */
@media (max-width: 360px) {
    #products-menu {
        max-height: 220px;
        border-radius: 0 0 8px 8px;
    }
    
    .category-btn {
        padding: 0.6rem 0.7rem;
        font-size: 0.8rem;
        min-height: 42px;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .category-btn:last-child {
        border-radius: 0 0 8px 8px;
    }
    
    #products-btn.nav-btn {
        border-radius: 8px 8px 0 0;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    #products-menu {
        max-height: 200px; /* Reduced height for landscape */
        border-radius: 0 0 10px 10px;
    }
    
    .category-btn {
        padding: 0.6rem 1rem;
        min-height: 40px;
        font-size: 0.85rem;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .category-btn:last-child {
        border-radius: 0 0 10px 10px;
    }
    
    #products-btn.nav-btn {
        padding: 0.6rem 1rem;
        border-radius: 10px 10px 0 0;
    }
}

/* Main Content Styles */
main {
    min-height: calc(100vh - 80px - 150px); /* Subtract header and footer approximate heights */
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    flex-grow: 1;
    overflow: hidden; /* Prevent content from overflowing */
}

/* Large screens - improve main section sizing */
@media (min-width: 1200px) {
    main {
        min-height: calc(100vh - 90px - 160px);
    }
}

@media (min-width: 1400px) {
    main {
        min-height: calc(100vh - 100px - 170px);
    }
}

@media (min-width: 1600px) {
    main {
        min-height: calc(100vh - 110px - 180px);
    }
}

#hero {
    text-align: center;
    padding: 4rem 2rem;
    background-position: center;
    background-size: cover;
    border-radius: 0;
    position: relative;
    color: white;
    height: 80vh;
    max-height: 600px;
    min-height: 500px;
    width: 100vw;
    max-width: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    box-sizing: border-box;
    transition: opacity 0.5s ease;
    /* Initially no background during welcome animation */
    background: none;
    transition: background 0.5s cubic-bezier(.4,0,.2,1);
    position: relative;
    z-index: 1;
    /* For fade-out effect */
    will-change: background, opacity;
    /* Prevent expansion during animations */
    overflow: hidden;
    contain: layout style;
}

#hero.hidden {
    display: none;
}

#hero.show-bg {
    background: url('../images/background/hero-bg.svg') center center/cover no-repeat;
    animation: heroBgFadeIn 0.5s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes heroBgFadeIn {
    0% {
        opacity: 0;
        background-size: cover;
    }
    100% {
        opacity: 1;
        background-size: cover;
    }
}

#hero.bg-fadeout {
    animation: heroBgFadeOut 2.5s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes heroBgFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

#hero.no-bg {
    background: #fff !important; /* Or 'transparent' if you want both to be transparent */
    opacity: 1;
    /* Ensure hero is white or transparent to match product animation container */
}

/* Utility class to synchronize backgrounds after hero animation */
.hero-bg-finished #hero.no-bg,
.hero-bg-finished .product-animation-container {
    background: #fff !important; /* Or 'transparent' for both */
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#hero h2 {
    color: var(--primary-color);
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#hero p {
    color: var(--white);
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

/* Large screens - allow hero section to expand properly */
@media (min-width: 1200px) {
    #hero {
        max-height: none;
        min-height: 70vh;
        height: auto;
        min-height: max(70vh, 600px);
    }
}

@media (min-width: 1400px) {
    #hero {
        min-height: max(75vh, 700px);
        padding: 6rem 2rem;
    }
}

@media (min-width: 1600px) {
    #hero {
        min-height: max(80vh, 800px);
        padding: 8rem 2rem;
    }
}

#products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

@media (hover: none) {
    .product-card:hover {
        transform: none; /* Disable hover effect on touch devices */
    }
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px 8px 0 0;
    position: relative;
    /* Add initial state for smooth appearance */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: productImageAppear 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.product-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-details {
    padding: 1.5rem;
}

.product-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #1a2233;
    word-break: break-word;
    overflow-wrap: break-word;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 0 #fff;
}

.product-description {
    color: var(--dark-gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    /* Limit to 3 lines with scrollbar */
    max-height: calc(1.4em * 3); /* 3 lines based on line-height */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px; /* Space for scrollbar */
    box-sizing: border-box;
}

/* Custom scrollbar for product description */
.product-description::-webkit-scrollbar {
    width: 6px;
}

.product-description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.product-description::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.product-description::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.product-price {
    font-size: 1.1rem; /* Reduced from 1.25rem */
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.7rem; /* Reduced from 1rem */
}

/* Offer Price Styles */
.offer-price-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.offer-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.original-price {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--dark-gray);
    text-decoration: line-through;
}

.discount-badge {
    background-color: #e74c3c;
    color: var(--white);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.3rem;
}

.product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem; /* Added small gap for better spacing */
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    background-color: var(--light-gray);
    color: var(--black);
    width: 25px; /* Reduced from 30px */
    height: 25px; /* Reduced from 30px */
    font-size: 1rem; /* Reduced from 1.2rem */
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: var(--gray);
}

.quantity-input {
    width: 35px; /* Reduced from 40px */
    height: 25px; /* Reduced from 30px */
    border: none;
    text-align: center;
    font-size: 0.85rem; /* Reduced from 0.9rem */
}

.add-to-cart {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.4rem 0.8rem; /* Reduced from 0.6rem 1rem */
    font-size: 0.85rem; /* Reduced from 0.9rem */
    font-weight: 500;
    border-radius: 4px;
}

.add-to-cart:hover {
    background-color: #d6b478;
    transform: scale(1.05);
}

/* Cart Modal Styles */
#cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: flex;
    justify-content: flex-end;
    transition: var(--transition);
}

#cart-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.cart-content {
    background-color: var(--white);
    width: 400px;
    max-width: 100%;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.cart-header h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.cart-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-cart-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(197, 161, 100, 0.3);
}

.empty-cart-btn:hover {
    background-color: #d6b478;
    transform: scale(1.1);
}

.empty-cart-btn:active {
    transform: scale(0.95);
}

#close-cart {
    background: none;
    color: var(--dark-gray);
    font-size: 1.5rem;
}

#cart-items {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--gray);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
}

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

.cart-item-title {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--secondary-color);
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.cart-quantity-btn {
    background-color: var(--light-gray);
    color: var(--black);
    width: 24px;
    height: 24px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.cart-quantity {
    margin: 0 0.5rem;
    font-size: 0.9rem;
}

.cart-remove-btn {
    color: #f44336;
    background: none;
    margin-left: 1rem;
}

.cart-footer {
    border-top: 1px solid var(--gray);
    padding-top: 1.5rem;
}

.cart-total {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-align: center;
    flex-direction: column;
    gap: 0.5rem;
}

#cart-total-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    text-align: center;
}

#send-order-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
}

#send-order-btn:hover {
    background-color: #d6b478;
}

/* Order Form Styles */
#order-form-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    padding: 20px;
}

#order-form-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.order-form {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    max-height: 80vh;
    min-height: 300px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--light-gray);
}

.order-form::-webkit-scrollbar {
    width: 8px;
}

.order-form::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.order-form::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.order-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray);
    padding-bottom: 1rem;
}

.order-form-header h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
}

#close-form {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-height: 36px !important; /* Override touch-friendly min-height */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(197, 161, 100, 0.3);
    font-size: 1.2rem;
}

#close-form:hover {
    background-color: #d6b478;
    transform: scale(1.1);
}

#close-form:active {
    transform: scale(0.95);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--gray);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input.error {
    border-color: #f44336;
}

.error-message {
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.field-note {
    color: var(--dark-gray);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-style: italic;
}

.form-note {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.5rem;
    text-align: left;
}

.required::after {
    content: " *";
    color: #f44336;
}

.order-summary {
    background-color: var(--light-gray);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.order-summary h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

#order-summary-items p {
    margin-bottom: 0.5rem;
}

#order-summary-items p:last-child {
    margin-bottom: 0;
}

#order-summary-total {
    margin-top: 1rem;
}

.submit-order-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    margin-top: 1rem;
}

.submit-order-btn:hover {
    background-color: #d6b478;
}

/* Footer Styles */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 3rem 2rem;
    margin-top: 0;
    text-align: center;
}

.contact-info {
    margin-bottom: 1.5rem;
    display: block;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

.contact-item {
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 1.8rem;
}

.contact-info p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.2rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.85rem;
}

/* Products Section Styles */
#products-section {
    padding: 1rem 2rem 4rem 2rem;
    background-color: var(--light-gray);
    min-height: 70vh; /* Match the hero height for smoother transition */
}

#products-section.hidden {
    display: none;
}

#products-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Section Header Styles */
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3.5rem;
    position: relative;
    gap: 1.5rem;
}

/* Button container for back and offers buttons */
.section-header .button-row {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center;
    width: 100% !important;
    flex-direction: row !important;
}

/* Specific button positioning */
.section-header .button-row .back-btn {
    order: 1;
    align-self: center;
    margin-right: auto;
}

.section-header .button-row .offers-btn {
    order: 2;
    align-self: center;
    margin-left: auto;
}

/* Back Button Styles */
.back-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(197, 161, 100, 0.3);
}

.back-btn:hover {
    background-color: #d6b478;
    transform: scale(1.1);
}

.back-btn.hidden {
    display: none;
}

/* Offers Button Styles */
.offers-btn {
    background: linear-gradient(135deg, var(--primary-color), #d6b478);
    color: var(--secondary-color);
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(197, 161, 100, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.offers-btn::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;
}

.offers-btn:hover::before {
    left: 100%;
}

.offers-btn:hover {
    background: linear-gradient(135deg, #d6b478, #e6c488);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(197, 161, 100, 0.6);
}

.offers-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(197, 161, 100, 0.4);
}

.offers-btn.hidden {
    display: none;
}

#category-title {
    color: var(--secondary-color);
    font-size: 2rem;
    margin: 2rem 0 0 0;
    text-align: center;
    padding: 0;
}

/* Welcome Overlay Styles */
.welcome-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 31, 44, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1);
}

.welcome-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.welcome-text {
    color: #ffe066;
    font-size: 2.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 4px 24px #000, 0 1px 0 #fff2;
    animation: popIn 1.2s cubic-bezier(0.4,0,0.2,1);
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.7) translateY(40px); }
    60% { opacity: 1; transform: scale(1.1) translateY(-10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Image Modal Styles */
#image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    padding: 20px;
}

#image-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-image-container {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
}

.modal-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    justify-content: center;
}

.modal-image {
    max-width: 60vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    /* Add initial state for smooth appearance */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: productImageAppear 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes productImageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-image-title {
    color: #181818;
    font-size: 1.05rem;
    margin: 0;
    text-align: justify;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    font-weight: 400;
    line-height: 1.45;
    width: 100%;
    max-width: 520px;
    min-height: 1.5em;
    max-height: 320px;
    background: #f8fcff; /* white ice */
    padding: 1.1rem 1.5rem 1.1rem 1.5rem;
    border-radius: 14px;
    box-shadow: 0 8px 32px 0 rgba(60, 80, 120, 0.18), 0 1.5px 8px rgba(0,0,0,0.07);
    border: 1px solid #e3eaf2;
    word-wrap: break-word;
    hyphens: auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    height: auto;
    box-sizing: border-box;
    transition: height 0.3s ease, background 0.3s;
    scrollbar-width: thin;
    scrollbar-color: #c7d6e6 #f8fcff;
}

/* Custom scrollbar for modal description */
.modal-image-title::-webkit-scrollbar {
    width: 6px;
}

.modal-image-title::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.modal-image-title::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.modal-image-title::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbar */
.modal-image-title {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.close-image-modal {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--white);
    color: var(--black);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    z-index: 1003;
}

.close-image-modal:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

/* Map Modal Styles */
#map-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    padding: 20px;
}

#map-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.map-modal-container {
    position: relative;
    background-color: var(--white);
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.map-modal-container h3 {
    color: var(--secondary-color);
    text-align: center;
    padding: 1.5rem 1.5rem 0.5rem;
    margin: 0;
    font-size: 1.3rem;
}

.close-map-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--white);
    color: var(--black);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    z-index: 1002;
}

.close-map-modal:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

.map-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.map-info {
    text-align: center;
    padding: 1rem 1.5rem;
    margin: 0;
    color: var(--dark-gray);
    font-size: 0.95rem;
    background-color: var(--light-gray);
}

/* Contact Icons Styles */
.contact-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-item span,
.contact-item a {
    display: inline-block;
    line-height: 1.4;
}

/* Ensure all icons have consistent sizing */
.contact-item svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
    transition: var(--transition);
}

/* Instagram icon specific styling */
.instagram-icon {
    width: 18px !important;
    height: 18px !important;
    color: var(--primary-color);
    flex-shrink: 0;
    transition: var(--transition);
}

.instagram-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.instagram-link:hover {
    color: #d6b478;
    text-decoration: underline;
}

.instagram-link:active {
    opacity: 0.7;
}

/* Hover effects for contact items */
.contact-item:hover svg {
    color: #d6b478;
    transform: scale(1.05);
}

.contact-item:hover .address-clickable {
    color: #d6b478;
    text-decoration: none;
}

.contact-item:hover .instagram-link {
    color: #d6b478;
    text-decoration: underline;
}

/* Mobile icon adjustments */
@media (max-width: 768px) {
    .contact-item svg,
    .instagram-icon {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Offers functionality mobile adjustments */
    .section-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        position: relative;
        padding-top: 1rem; /* Reduced padding since buttons are no longer absolutely positioned */
        margin-bottom: 3rem; /* Ensure adequate space to products on mobile */
    }
    
    .button-row {
        flex-direction: row !important;
        justify-content: flex-start !important;
        width: 100% !important;
        display: flex !important;
    }
    
    .back-btn {
        /* Remove absolute positioning - now uses flexbox */
        position: static;
    }
    
    .offers-btn {
        /* Remove absolute positioning - now uses flexbox */
        position: static;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }
    
    #category-title {
        margin-top: 2rem; /* Increase margin for better spacing from header */
        padding: 0 1rem; /* Reduce padding on mobile */
        font-size: 1.8rem; /* Slightly smaller on mobile */
    }
    
    .offer-price-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .discount-badge {
        align-self: flex-start;
    }
}

/* --- SEARCH BAR MOBILE SIZE FIX --- */
@media (max-width: 576px) {
    .search-container {
        margin: 0.3rem 0 0.3rem 0;
        width: 100%;
        max-width: 100%;
    }
    #search-input {
        font-size: 0.92rem;
        padding: 0.35rem 0.5rem;
        height: 2.1rem;
        min-height: unset;
        max-width: 100%;
        border-radius: 4px;
    }
}
/* --- END SEARCH BAR MOBILE SIZE FIX --- */

/* Responsive Styles */
/* Large screens (desktops) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        margin: 0 auto;
    }
    
    #products-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium screens (tablets) */
@media (max-width: 992px) {
    #products-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    #hero h2 {
        font-size: 2.5rem;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Small screens (small tablets and large phones) */
@media (max-width: 768px) {
    main {
        min-height: calc(100vh - 120px - 180px); /* Adjust for mobile header/footer heights */
        width: 100vw;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    header {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .logo-container {
        margin-bottom: 0;
    }
    
    .search-container {
        width: 100%;
        margin: 0;
    }
    
    .nav-container {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-btn-container {
        position: static;
        margin-right: 0;
    }
    
    #products-menu {
        width: 100%;
        position: relative;
        top: 5px;
        left: 0;
        z-index: 100;
        max-height: 250px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    #products-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .cart-content {
        width: 100%;
    }

    .order-form {
        width: 95%;
        padding: 1.5rem;
    }
    
    #hero {
        height: 70vh;
        min-height: 400px;
        max-height: 500px;
        padding: 2rem 1rem;
        width: 100vw;
        max-width: none;
        margin: 0 auto;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        left: 50%;
        transform: translateX(-50%);
    }
    
    #hero h2 {
        font-size: 2rem;
    }
    
    #hero p {
        font-size: 1.1rem;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .modal-image-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        max-width: 95vw;
    }
    
    .modal-image {
        max-width: 90vw;
        max-height: 60vh;
    }
    
    .modal-image-title {
        font-size: 0.85rem;
        padding: 1.2rem;
        width: 90vw;
        min-height: 1.45em; /* Minimum height for 1 line */
        max-height: calc(1.45em * 3 + 2.4rem); /* 3 lines + padding */
        margin-top: 0;
        line-height: 1.45;
    }
    
    .close-map-modal {
        width: 35px;
        height: 35px;
        font-size: 1.4rem;
    }
    
    .map-modal-container {
        max-width: 95vw;
        margin: 0 10px;
    }
    
    .map-modal_container h3 {
        font-size: 1.1rem;
        padding: 1rem 1rem 0.5rem;
    }
    
    .map-container {
        height: 250px;
    }
    
    .map-info {
        font-size: 0.85rem;
        padding: 0.8rem 1rem;
    }
    
    footer {
        padding: 2rem 1rem;
        margin-top: 0;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        text-align: center;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .contact-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    
    .contact-info p {
        font-size: 0.85rem;
        margin: 0.2rem 0;
    }
    
    .copyright {
        padding-top: 1rem;
        font-size: 0.8rem;
    }
}

/* Tablet responsive styles */
@media (max-width: 768px) and (min-width: 577px) {
    .nav-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    #home-btn {
        flex: 0 0 90px;
        min-width: 90px;
        max-width: 90px;
        padding: 0.5rem 0.4rem;
        font-size: 0.85rem;
    }
    
    #products-btn.nav-btn {
        min-width: 150px;
    }
    
    #products-menu {
        min-width: 150px;
        max-width: 250px;
    }
    
    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Extra small screens (phones) */
@media (max-width: 576px) {
    header {
        flex-direction: column;
        align-items: center;
        padding: 0.6rem 0.5rem;
        gap: 0.5rem;
    }
    .logo-container {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 0;
        gap: 0.5rem;
    }
    .logo {
        height: 32px;
        margin-right: 6px;
    }
    .logo-container h1 {
        font-size: 1.1rem;
        margin: 0;
    }
    .search-container {
        width: 100%;
        margin: 0.3rem 0 0.2rem 0;
        display: flex;
        justify-content: center;
    }
    #search-input {
        width: 100%;
        max-width: 350px;
        padding: 0.35rem;
        font-size: 0.9rem;
    }
    .nav-container {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.3rem;
        margin: 0;
    }
    
    #home-btn {
        flex: 0 0 80px; /* Fixed smaller width for home button */
        min-width: 80px;
        max-width: 80px;
        margin: 0;
        padding: 0.5rem 0.3rem;
        font-size: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-btn-container {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        max-width: 180px; /* Allow more space for wider button */
    }
    
    #cart-btn {
        flex: 0 0 40px; /* Fixed width for cart button */
        width: 40px;
        min-width: 40px;
        height: 34px;
        padding: 0;
        margin: 0;
    }
    
    .nav-btn {
        width: 100%;
        padding: 0.5rem 0.4rem;
        font-size: 0.85rem;
        min-width: 0;
    }
    
    #products-btn.nav-btn {
        min-width: 140px; /* Increased width for mobile but smaller than desktop */
        width: 100%;
        font-size: 0.85rem;
        padding: 0.5rem 0.6rem;
    }
    
    .nav-btn-container {
        position: relative;
        width: 100%;
        max-width: 180px; /* Allow more space for wider button */
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #products-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        min-width: 140px; /* Match the products button width */
        margin-top: 2px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        border-radius: 0 0 4px 4px;
        z-index: 9999;
        max-height: 250px;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background-color: var(--primary-color);
        padding: 0.5rem 0;
    }
    #products-menu.hidden {
        display: none;
    }
    .category-btn {
        width: 100%;
        text-align: left;
        padding: 0.6rem 1.2rem; /* Increased padding for better text spacing */
        font-size: 0.85rem;
        line-height: 1.3;
        word-wrap: break-word;
        white-space: normal;
    }
    
    .product-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .quantity-control {
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
        justify-content: center;
    }
    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    .quantity-input {
        width: 40px;
        height: 32px;
        font-size: 1rem;
    }
}

/* Contact grid mobile improvements */
@media (max-width: 480px) {
    main {
        min-height: calc(100vh - 140px - 200px); /* Adjust for smaller mobile header/footer heights */
        width: 100vw;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        max-width: 280px;
    }
    
    .contact-item {
        font-size: 0.85rem;
        text-align: center;
        justify-content: center;
    }
    
    .contact-info h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

/* Landscape orientation specific styles */
@media (max-width: 768px) and (orientation: landscape) {
    #hero {
        height: 90vh; /* Adjust height for landscape */
        width: 100vw;
        max-width: none;
        margin: 0 auto;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        left: 50%;
        transform: translateX(-50%);
    }
    
    header {
        padding: 0.5rem;
    }
    
    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    #home-btn, .nav-btn-container {
        margin-right: 8px;
        width: auto;
    }
    
    .product-card {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .product-image {
        height: 150px;
    }
    
    .order-form {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Make touch targets larger for buttons */
    .nav-btn, .category-btn, .add-to-cart, .submit-order-btn, #close-cart, #close-form {
        min-height: 44px;
    }
    
    /* Increase padding for better touch targets */
    .form-group input, #search-input {
        padding: 12px;
    }
    
    /* Improved spacing for touch targets */
    .quantity-btn {
        width: 36px;
        height: 36px;
    }
    
    .quantity-input {
        height: 36px;
    }
    
    /* Prevent zooming on inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Improve scrolling */
    .cart-items {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better tap feedback */
    .nav-btn:active, .category-btn:active, .add-to-cart:active, .cart-btn:active {
        opacity: 0.7;
    }
    
    /* Map modal and image modal touch improvements */
    .close-map-modal, .close-image-modal {
        min-width: 44px;
        min-height: 44px;
    }
    
    .product-image:hover {
        transform: none; /* Disable hover on touch devices */
    }
    
    .address-clickable:active {
        opacity: 0.7;
    }
}

/* Fluid typography */
@media (min-width: 992px) {
    h1 {
        font-size: calc(1.8rem + var(--fluid-typography-ratio));
    }
    
    h2 {
        font-size: calc(1.5rem + var(--fluid-typography-ratio));
    }
    
    h3 {
        font-size: 0.8rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* Print styles */
@media print {
    header, footer, .nav-container, .search-container, #cart-btn {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        font-size: 12pt;
    }
}

/* High resolution screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Make the confirm order form scrollable and always accessible on small screens and small laptops. */
@media (max-width: 900px) {
    #order-form-container {
        padding: 10px;
    }
    .order-form {
        max-height: 85vh;
        min-height: 280px;
        overflow-y: auto;
        width: 100%;
        max-width: 380px;
        padding: 1rem;
        border-radius: 6px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    }
    .order-form-header h3 {
        font-size: 1.1rem;
    }
    .form-group {
        margin-bottom: 1rem;
    }
    .form-group label {
        font-size: 0.95rem;
    }
    .form-group input {
        font-size: 0.95rem;
        padding: 0.6rem;
    }
    .submit-order-btn {
        font-size: 1rem;
        padding: 0.6rem;
        margin-top: 0.5rem;
    }
    .order-summary {
        padding: 0.7rem;
        font-size: 0.8rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .order-summary h4 {
        font-size: 1rem;
    }
    .form-note {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    #order-form-container {
        padding: 5px;
    }
    .order-form {
        max-height: 90vh;
        min-height: 250px;
        width: 100%;
        max-width: 95vw;
        padding: 0.8rem;
    }
    .order-form-header h3 {
        font-size: 1rem;
    }
    .form-group {
        margin-bottom: 0.8rem;
    }
    .form-group label {
        font-size: 0.9rem;
    }
    .form-group input {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    .submit-order-btn {
        font-size: 0.95rem;
        padding: 0.6rem;
    }
    .order-summary {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    .order-summary h4 {
        font-size: 0.95rem;
    }
    .form-note {
        font-size: 0.75rem;
    }
}

/* Extra small screens - mobile image modal adjustments */
@media (max-width: 576px) {
    .modal-image-container {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        max-width: 95vw;
    }
    
    .modal-image {
        max-height: 50vh;
        max-width: 95vw;
    }
    
    .modal-image-title {
        font-size: 0.8rem;
        margin-top: 0;
        padding: 1rem;
        width: 95vw;
        min-height: 1.4em; /* Minimum height for 1 line at smaller font size */
        max-height: calc(1.4em * 3 + 2rem); /* 3 lines at smaller font size + smaller padding */
        line-height: 1.4;
    }
    
    .close-image-modal {
        width: 35px;
        height: 35px;
        font-size: 1.4rem;
        top: -15px;
        right: -15px;
    }
    
    .map-modal-container {
        max-width: 98vw;
        margin: 0 5px;
    }
    
    .map-modal_container h3 {
        font-size: 1rem;
        padding: 0.8rem 0.8rem 0.3rem;
    }
    
    .map-container {
        height: 200px;
    }
    
    .map-info {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Touch device improvements for image modal */
@media (hover: none) and (pointer: coarse) {
    .close-image-modal {
        min-width: 44px;
        min-height: 44px;
    }
    
    .product-image:hover {
        transform: none; /* Disable hover on touch devices */
    }
}

/* Very short screens (landscape phones, small windows) */
@media (max-height: 500px) {
    .product-animation-container {
        max-height: 80vh;
        min-height: 220px;
        padding: 1.5rem 1rem;
        border-radius: 8px;
        background: linear-gradient(135deg, 
            rgba(197, 161, 100, 0.03) 0%, 
            rgba(15, 31, 44, 0.04) 100%);
        box-shadow: 
            0 2px 10px rgba(0, 0, 0, 0.04),
            0 1px 4px rgba(0, 0, 0, 0.03);
    }
    
    .product-animation-image {
        max-height: min(45vh, 150px);
        max-width: min(90vw, 300px);
        min-height: 60px;
        min-width: 90px;
    }
}

/* Extremely short screens */
@media (max-height: 400px) {
    .product-animation-container {
        max-height: 75vh;
        min-height: 180px;
        padding: 1.2rem 0.8rem;
        border-radius: 6px;
        background: linear-gradient(135deg, 
            rgba(197, 161, 100, 0.02) 0%, 
            rgba(15, 31, 44, 0.03) 100%);
        box-shadow: 
            0 1px 8px rgba(0, 0, 0, 0.03),
            0 1px 3px rgba(0, 0, 0, 0.02);
    }
    
    .product-animation-image {
        max-height: min(37.5vh, 120px);
        max-width: min(75vw, 225px);
        min-height: 45px;
        min-width: 75px;
    }
}

/* Ultra short screens (very small windows) */
@media (max-height: 300px) {
    .product-animation-container {
        max-height: 70vh;
        min-height: 150px;
        padding: 1rem 0.6rem;
        border-radius: 4px;
        background: linear-gradient(135deg, 
            rgba(197, 161, 100, 0.015) 0%, 
            rgba(15, 31, 44, 0.025) 100%);
        box-shadow: 
            0 1px 6px rgba(0, 0, 0, 0.02),
            0 1px 2px rgba(0, 0, 0, 0.015);
    }
    
    .product-animation-image {
        max-height: min(30vh, 90px);
        max-width: min(60vw, 180px);
        min-height: 37.5px;
        min-width: 60px;
    }
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.contact-item a:hover {
    color: #d6b478;
    text-decoration: underline;
}

.contact-item a:active {
    opacity: 0.7;
}

/* Enhanced Product Animation Styles */
.product-animation-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(95vw, 1400px);
    height: auto;
    min-height: 400px;
    max-height: min(80vh, 600px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
    box-sizing: border-box;
    overflow: hidden;
    /* Prevent images from overlapping */
    z-index: 2;
    overflow: hidden;
    background: #fff; /* Or 'transparent' to match hero if needed */
    z-index: 2;
    text-align: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
    /* Initially hidden - will be shown when product animation starts */
    opacity: 0;
    transition: opacity 0.3s ease-out;
    /* Remove all background styling for clean appearance */
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    /* Prevent expansion during animations and optimize performance */
    contain: layout style;
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate(-50%, -50%) translateZ(0);
    -webkit-transform: translate(-50%, -50%) translateZ(0);
}

/* Large screens - allow product animation container to expand */
@media (min-width: 1200px) {
    .product-animation-container {
        max-height: none !important;
        min-height: 500px !important;
        width: min(90vw, 1400px) !important;
        padding: 3rem 2rem;
    }
}

@media (min-width: 1400px) {
    .product-animation-container {
        min-height: 600px !important;
        width: min(90vw, 1600px) !important;
        padding: 4rem 3rem;
    }
}

@media (min-width: 1600px) {
    .product-animation-container {
        min-height: 650px !important;
        width: min(90vw, 1800px) !important;
        padding: 5rem 4rem;
    }
}

@media (min-width: 1920px) {
    .product-animation-container {
        min-height: 600px !important;
        width: min(80vw, 1800px) !important;
        padding: 4rem 3rem;
    }
}

@media (min-width: 2560px) {
    .product-animation-container {
        min-height: 650px !important;
        width: min(75vw, 2000px) !important;
        padding: 5rem 4rem;
    }
}

/* TV screens and very large displays */
@media (min-width: 3000px) {
    .product-animation-container {
        min-height: 700px !important;
        width: min(70vw, 2200px) !important;
        padding: 6rem 5rem;
    }
}

@media (min-width: 4000px) {
    .product-animation-container {
        min-height: 750px !important;
        width: min(65vw, 2400px) !important;
        padding: 8rem 6rem;
    }
}

/* Responsive fix for Kindle and iPad screens: show only the first image in animation container */
@media only screen and (max-width: 1024px) {
  .product-animation-container img:nth-child(2) {
    display: none !important;
  }
}

/* For wide screens, keep both images visible */
@media only screen and (min-width: 1025px) {
  .product-animation-container img {
    display: inline-block;
  }
}

.product-animation-container.visible {
       opacity: 1;
}

/* Background refinements for animation container */
.product-animation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(197, 161, 100, 0.02) 0%, 
        transparent 50%, 
        rgba(15, 31, 44, 0.02) 100%);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.5;
}

/* Ensure the container background adapts to content */
.product-animation-container.has-content {
    background: #fff; /* Or 'transparent' to match hero if needed */
}

/* Enhance the visual depth when images are present */
.product-animation-container:not(:empty) {
    box-shadow: 
        0 8px 35px rgba(0, 0, 0, 0.08),
        0 3px 15px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Responsive background adjustments */
@media (max-width: 768px) {
    .product-animation-container::before {
        opacity: 0.3;
    }
}

@media (max-width: 480px) {
    .product-animation-container::before {
        opacity: 0.2;
    }
}

.product-animation-flex {
    display: flex;
    gap: 2rem;
    width: auto;
    height: auto;
    justify-content: center;
    align-items: center;
    /* Prevent layout shifts during animations */
    position: relative;
    contain: layout style;
    /* Ensure horizontal layout on larger screens */
    flex-direction: row;
    flex-wrap: nowrap;
}

/* MacBook 13-inch and smaller laptops */
@media (min-width: 1200px) and (max-width: 1440px) {
    .product-animation-flex {
        gap: 1.5rem;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
    }
    
    .product-animation-container {
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-animation-image {
        max-width: min(58vw, 880px) !important;
        max-height: min(63vh, 620px) !important;
        min-width: 440px;
        min-height: 280px;
        flex-shrink: 1;
    }
}

/* MacBook 15-inch and similar displays */
@media (min-width: 1441px) and (max-width: 1800px) {
    .product-animation-flex {
        gap: 1.5rem;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
    
    .product-animation-container {
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        max-height: min(75vh, 600px);
        gap: 1.5rem;
        padding: 3rem 2rem;
    }
    
    .product-animation-image {
        max-width: min(58vw, 880px) !important;
        max-height: min(54vh, 580px) !important;
        min-width: 420px;
        min-height: 270px;
        flex-shrink: 1;
        margin: 0.5rem;
    }
}

.product-animation-image {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    width: auto;
    height: auto;
    /* Base sizing - will be overridden by media queries */
    max-width: min(100vw, 600px);
    max-height: min(75vh, 480px);
    min-width: 380px;
    min-height: 240px;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    /* Enhanced shadow and glow effects */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    background: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin: 0.5rem;
    /* Image quality optimization */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Smooth scaling */
    will-change: transform, filter;
    /* Professional border - removed white border */
    border: none;
    /* Initial hidden state - animation will be triggered via JavaScript */
    opacity: 0;
    /* transform: translateY(20px) scale(0.95); */
    pointer-events: none;
    /* Prevent overlap */
    flex-shrink: 1;
    flex-grow: 0;
    z-index: 3;
}

/* Large screens - allow images to scale better */
@media (min-width: 1200px) and (max-width: 1440px) {
    .product-animation-container {
        max-height: min(75vh, 550px);
        gap: 1.5rem;
        padding: 2.5rem;
    }
    
    .product-animation-image {
        max-width: min(75vw, 1100px) !important;
        max-height: min(58vh, 580px) !important;
        min-width: 450px;
        min-height: 280px;
        margin: 0.75rem;
    }
}

@media (min-width: 1441px) and (max-width: 1700px) {
    .product-animation-container {
        max-height: min(75vh, 580px);
        gap: 1.5rem;
        padding: 3rem;
    }
    
    .product-animation-image {
        max-width: min(78vw, 1150px) !important;
        max-height: min(60vh, 610px) !important;
        min-width: 470px;
        min-height: 300px;
        margin: 0.75rem;
    }
}

@media (min-width: 1701px) {
    .product-animation-container {
        max-height: min(75vh, 620px);
        gap: 2rem;
        padding: 3.5rem;
    }
    
    .product-animation-image {
        max-width: min(70vw, 1100px) !important;
        max-height: min(54vh, 580px) !important;
        min-width: 440px;
        min-height: 270px;
        margin: 1rem;
    }
}

@media (min-width: 1920px) {
    .product-animation-container {
        max-height: min(75vh, 650px);
        gap: 2rem;
        padding: 4rem;
    }
    
    .product-animation-image {
        max-width: min(80vw, 1350px) !important;
        max-height: min(65vh, 680px) !important;
        min-width: 520px;
        min-height: 330px;
        margin: 1rem;
    }
}

@media (min-width: 2560px) {
    .product-animation-container {
        max-height: min(75vh, 700px);
        gap: 2.5rem;
        padding: 4.5rem;
    }
    
    .product-animation-image {
        max-width: min(82vw, 1450px) !important;
        max-height: min(67vh, 720px) !important;
        min-width: 550px;
        min-height: 350px;
        margin: 1.25rem;
    }
}

/* TV screens and very large displays - keep images reasonable */
@media (min-width: 3000px) {
    .product-animation-container {
        max-height: min(75vh, 750px);
        gap: 3rem;
        padding: 5rem;
    }
    
    .product-animation-image {
        max-width: min(82vw, 1500px) !important;
        max-height: min(67vh, 720px) !important;
        min-width: 560px;
        min-height: 360px;
        margin: 1.5rem;
    }
}

/* Ultra-wide and 8K displays - prevent images from becoming too dominant */
@media (min-width: 4000px) {
    .product-animation-container {
        max-height: min(75vh, 800px);
        gap: 3.5rem;
        padding: 5.5rem;
    }
    
    .product-animation-image {
        max-width: min(84vw, 1600px) !important;
        max-height: min(69vh, 760px) !important;
        min-width: 580px;
        min-height: 380px;
        margin: 1.75rem;
    }
}



/* Animation utility classes with CSS custom properties */
.fade-in {
    animation: dynamicFadeIn var(--animation-duration) var(--animation-easing) var(--animation-delay) forwards;
}

.slide-in-left {
    animation: dynamicSlideInLeft var(--animation-duration) var(--animation-easing) var(--animation-delay) forwards;
}

.slide-in-right {
    animation: dynamicSlideInRight var(--animation-duration) var(--animation-easing) var(--animation-delay) forwards;
}

.zoom-in {
    animation: dynamicZoomIn var(--animation-duration) var(--animation-easing) var(--animation-delay) forwards;
}

.fade-out {
    /* Temporarily disabled to fix upward movement issue */
    /* animation: dynamicFadeOut calc(var(--animation-duration) * 0.7) var(--animation-easing) forwards; */
    /* Fallback for manual style application */
    transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

/* Dynamic animations using CSS custom properties */
@keyframes dynamicFadeIn {
    0% {
        opacity: 0;
        transform: scale(var(--scale-factor)) translateY(var(--animation-distance));
        filter: blur(var(--blur-amount));
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes dynamicSlideInLeft {
    0% {
        opacity: 0;
        transform: translateX(calc(-1 * var(--animation-distance))) scale(var(--scale-factor)) rotate(calc(-1 * var(--rotation-angle)));
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1) rotate(0deg);
    }
}

@keyframes dynamicSlideInRight {
    0% {
        opacity: 0;
        transform: translateX(var(--animation-distance)) scale(var(--scale-factor)) rotate(var(--rotation-angle));
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1) rotate(0deg);
    }
}

@keyframes dynamicZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(calc(-2 * var(--rotation-angle)));
        filter: blur(calc(var(--blur-amount) * 1.5));
    }
    60% {
        opacity: 1;
        transform: scale(1.05) rotate(0deg);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0);
    }
}

@keyframes dynamicFadeOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.95) translateY(0);
        filter: blur(3px);
    }
}

/* Loading state for images */
.product-animation-image.loading {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(2px);
    transition: all 0.3s ease;
}

.product-animation-image.loaded {
    animation: productImageAppear 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Error state for failed images */
.product-animation-image.error {
    opacity: 0.3;
    filter: grayscale(100%);
}

/* Enhanced Responsive Design for Product Animation */
@media (max-width: 1200px) {
    .product-animation-container {
        max-height: 50vh;
        min-height: 450px;
        padding: 2.5rem 1.5rem;
        border-radius: 14px;
        box-shadow: 
            0 5px 25px rgba(0, 0, 0, 0.06),
            0 2px 10px rgba(0, 0, 0, 0.04),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
    
    .product-animation-image {
        max-width: min(90vw, 800px);
        max-height: min(50vh, 480px);
        min-width: 320px;
        margin: 0 0.8rem;
    }
    
    .product-animation-flex {
        gap: 2rem;
    }
}

@media (max-width: 900px) {
    .product-animation-container {
        max-height: 60vh;
        min-height: 350px;
        border-radius: 0;
        padding: 2rem 1rem;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    .product-animation-image {
        max-width: min(85vw, 650px);
        max-height: min(42vh, 380px);
        min-width: 280px;
        border-radius: 8px;
        margin: 0 0.5rem;
    }
    
    .product-animation-flex {
        gap: 1.5rem;
        flex-direction: row;
    }
}

@media (max-width: 700px) {
    .product-animation-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: 55vh; /* Reduced from 70vh */
        min-height: 320px; /* Reduced from 380px */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 2rem 1rem; /* Reduced from 2.5rem */
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-image {
        max-width: min(75vw, 350px); /* Reduced from 85vw, 450px */
        max-height: min(35vh, 280px); /* Reduced from 45vh, 320px */
        min-width: 200px; /* Reduced from 240px */
        min-height: 120px; /* Reduced from 140px */
        margin: 0.5rem 0;
        border-radius: 6px;
    }
    
    .product-animation-flex {
        flex-direction: column;
        gap: 0.5rem; /* Reduced from 1rem */
    }
}

@media (max-width: 480px) {
    .product-animation-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        max-height: 60vh; /* Reduced from 75vh */
        min-height: 300px; /* Reduced from 350px */
        height: auto;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        padding: 2rem 1rem; /* Reduced from 3rem */
        border-radius: 0;
        /* Remove background for clean appearance */
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-image {
        width: auto;
        height: auto;
        max-width: min(80vw, 300px); /* Reduced from 90vw, 400px */
        max-height: min(40vh, 250px); /* Reduced from 60vh, 350px */
        min-width: 200px; /* Reduced from 250px */
        min-height: 150px; /* Reduced from 180px */
        margin: 0.5rem auto; /* Reduced from 1rem */
        display: block;
        object-fit: contain;
        object-position: center;
        border-radius: 8px;
        /* Remove all shadows for clean appearance */
        box-shadow: none;
    }
    
    .product-animation-flex {
        flex-direction: column;
        width: 100%;
        height: auto;
        gap: 0.5rem; /* Reduced from 1rem */
        align-items: center;
        justify-content: center;
    }
    
    /* Disable parallax on mobile for better performance */
    .product-animation-container::before {
        display: none;
    }
}

/* Extra small screens - ensure no image cropping */
@media (max-width: 360px) {
    .product-animation-container {
        min-height: 250px; /* Reduced from 280px */
        max-height: 50vh; /* Reduced from 65vh */
        padding: 1.5rem 0.8rem; /* Reduced from 2rem */
        border-radius: 6px;
        background: linear-gradient(135deg, 
            rgba(197, 161, 100, 0.02) 0%, 
            rgba(15, 31, 44, 0.03) 100%);
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.025),
            0 1px 3px rgba(0, 0, 0, 0.02);
    }
    
    .product-animation-image {
        max-width: min(75vw, 250px); /* Reduced from 135vw, 300px */
        max-height: min(25vh, 180px); /* Reduced from 30vh, 150px */
        min-width: 150px; /* Reduced from 120px */
        min-height: 100px; /* Increased from 75px for better visibility */
        margin: 0.3rem auto; /* Reduced from 0.6rem */
    }
    
    .product-animation-flex {
        gap: 0.3rem; /* Reduced from 0.6rem */
    }
}

/* iPhone and narrow mobile specific styles */
@media (max-width: 390px) {
    .product-animation-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: 80vh;
        min-height: 320px;
        padding: 2.5rem 0.75rem;
        margin: 0;
        background: transparent;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-image {
        max-width: min(88vw, 360px);
        max-height: min(65vh, 320px);
        min-width: 220px;
        min-height: 160px;
               margin: 1.2rem auto;
        border-radius: 6px;
    }
    
    .product-animation-flex {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.2rem;
    }
}

/* Extra small iPhone SE styles */
@media (max-width: 320px) {
    .product-animation-container {
        min-height: 280px;
        max-height: 75vh;
        padding: 2rem 0.5rem;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-image {
        max-width: min(90vw, 300px);
        max-height: min(60vh, 250px);
        min-width: 200px;
        min-height: 140px;
    }
}

/* When products section is visible, hide the main content */
body:has(#products-section:not(.hidden)) main {
    display: none;
}

/* Fallback for browsers that don't support :has() */
main.products-active {
    display: none;
}

/* Image Navigation Buttons and Wrapper Styles */
.modal-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Touch-friendly improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.image-nav-btn.hidden {
    display: none !important;
    visibility: hidden !important;
}

.image-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

/* Touch devices - use active state instead of hover */
@media (hover: none) and (pointer: coarse) {
    .image-nav-btn:hover {
        background: rgba(0, 0, 0, 0.5);
        transform: translateY(-50%);
    }
    
    .image-nav-btn:active {
        background: rgba(0, 0, 0, 0.8);
        transform: translateY(-50%) scale(1.1);
    }
}

.prev-btn {
    left: -70px;
}

.next-btn {
    right: -70px;
}

.image-counter {
    color: var(--white);
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness for image navigation */
@media (max-width: 768px) {
    .modal-image-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-image {
        max-width: 90vw;
        max-height: 60vh;
    }
    
    .modal-image-title {
        width: 90vw;
        max-width: 90vw;
        min-height: 100px;
        max-height: 150px;
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    .image-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .image-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.8);
    }
    
    .prev-btn {
        left: 5px;
    }
    
    .next-btn {
        right: 5px;
    }
    
    .modal-image-title {
        font-size: 0.75rem;
        padding: 0.8rem;
        max-width: 95vw;
        min-height: 1.3em; /* Minimum height for 1 line at smallest font size */
        max-height: calc(1.3em * 3 + 1.6rem); /* 3 lines + padding */
        line-height: 1.3;
    }
}

@media (max-width: 360px) {
    .image-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        background: rgba(0, 0, 0, 0.9);
    }
    
    .prev-btn {
        left: 2px;
    }
    
    .next-btn {
        right: 2px;
    }
    
    .modal-image {
        max-width: 95vw;
        max-height: 55vh;
    }
}

/* Mobile-specific constraints to prevent overflow */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        position: relative;
    }
    
    #hero {
        height: 65vh;
        min-height: 350px;
        max-height: 450px;
        padding: 2rem 1rem;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        overflow: hidden;
        position: relative;
    }
    
    /* Ensure animation container never overflows */
    .product-animation-container {
        max-width: 100vw !important;
        width: 100vw !important;
        left: 0 !important;
        transform: translateY(-50%) !important;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-flex {
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-image {
        max-width: 85vw !important;
        box-sizing: border-box;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    body {
        overflow-x: hidden;
        position: relative;
    }
    
    #hero {
        height: 60vh;
        min-height: 300px;
        max-height: 400px;
        padding: 1.5rem 1rem;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        overflow: hidden;
        position: relative;
    }
    
    /* Ensure animation container never overflows */
    .product-animation-container {
        max-width: 100vw !important;
        width: 100vw !important;
        left: 0 !important;
        transform: translateY(-50%) !important;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-flex {
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .product-animation-image {
        max-width: 90vw !important;
        box-sizing: border-box;
    }
}

/* Force single product display on small screens */
@media (max-width: 767px) {
    .product-animation-image:nth-child(n+2) {
        display: none !important;
    }
    
    .product-animation-flex {
        flex-direction: column !important;
        gap: 0.5rem !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .product-animation-container {
        padding: 1.5rem 1rem !important;
        max-height: 55vh !important;
    }
}

/* Very small devices - ultra conservative approach */
@media (max-width: 480px) {
    .product-animation-image:nth-child(n+2) {
        display: none !important;
    }
    
    .product-animation-image:first-child {
        max-width: 75vw !important;
        max-height: 35vh !important;
        min-width: 220px !important;
        min-height: 140px !important;
        margin: 0.5rem auto !important;
    }
    
    .product-animation-container {
        padding: 1rem 0.5rem !important;
        max-height: 50vh !important;
        min-height: 250px !important;
    }
    
    .product-animation-flex {
        gap: 0 !important;
    }
}
@media (max-width: 376px) {
    .product-animation-container {
        padding: 1rem 0.5rem;
    }
    
    .product-animation-image {
        max-width: 95vw;
        max-height: 55vh;
    }
}

@media (max-width: 768px) {
  .modal {
    flex-direction: column;
    align-items: center;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .modal-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
    max-height: 450px !important;
  }
  .modal-description {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: justify;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    word-break: break-word;
  }
}

/* Optionally, target specific device heights for further refinement */
@media only screen and (max-width: 430px) and (max-height: 670px) {
  .modal-image {
    max-height: 350px !important;
  }
}
@media only screen and (min-width: 800px) and (max-width: 1280px) {
  .modal-image {
    max-height: 450px !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  /* iPad and Kindle screen optimizations */
  .product-animation-image {
    max-width: 65vw !important;
    max-height: 65vw !important;
    min-width: 300px !important;
    min-height: 300px !important;
    margin: 1rem !important;
  }
  
  .product-animation-container {
    max-height: min(70vh, 500px) !important;
    padding: 2rem !important;
  }
  
  .modal-content-flex {
    gap: 2rem;
  }
}
@media only screen and (min-width: 601px) and (max-width: 1024px) {
  .modal-content-flex {
    flex-direction:column !important;
    align-items: flex-start;
    justify-content: center;
    align-items: center;
    gap: 3rem !important;
  }
  
}

@media only screen and (min-width: 1025px) {
  .modal-description-section {
    min-height: 350px !important;
    max-height: 450px !important;
    height: 400px !important;
    max-width: 400px !important;
    width: 100% !important;
  }
}