@font-face {
    font-family: 'Canela';
    src: url('/fonts/Canela-Medium-Trial.otf') format('opentype');
}

/* Mobile Typography & Base */
body {
    font-size: 16px; /* Prevent iOS zoom on input focus */
    overflow-x: hidden; /* Prevent horizontal scroll (fallback for old browsers) */
}
/* STICKY FIX: `overflow-x: hidden` turns <body> into a scroll container, and anything
   `position: sticky` inside then sticks to a box that never scrolls - which is why the shop's
   filter sidebar scrolled away with the page. `clip` hides the same overflow WITHOUT creating
   a scroll container, so sticky works again. */
@supports (overflow-x: clip) {
    body { overflow-x: clip; }
}

/* Mobile Filter Drawer (Slide-up/Slide-over) */
.mobile-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.mobile-filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    background: white;
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.mobile-filter-open .mobile-filter-overlay {
    opacity: 1;
    visibility: visible;
}
.mobile-filter-open .mobile-filter-drawer {
    transform: translateY(0);
}

/* Generic Popup Styles */
.page-popup {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    left: 1rem; /* Mobile: stretch across bottom */
    max-width: 400px;
    margin: 0 auto; /* Center on larger screens if width < 100% */
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    /* Default State: Hidden */
    opacity: 0;
    visibility: hidden; 
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    display: none; /* Ensure it doesn't take space */
}

@media (min-width: 640px) {
    .page-popup { left: auto; bottom: 2rem; right: 2rem; }
}

/* Active State */
.page-popup.visible {
    display: block !important; /* Override inline style */
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.popup-btn-primary {
    background-color: #202328;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
}
.popup-btn-secondary {
    background: none;
    border: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .font-canela.text-6xl { font-size: 2.5rem; line-height: 1.1; }
    .font-canela.text-5xl { font-size: 2rem; }
    .font-canela.text-4xl { font-size: 1.75rem; }
    .container { padding-left: 1rem; padding-right: 1rem; }
    
}

/* Hide scrollbars but keep scrolling - used by the horizontal media strips AND by the
   desktop filter sidebar, which scrolls independently of the product grid. Was previously
   trapped inside a max-width:768px media query, so desktop still showed an ugly bar. */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Sitewide interaction polish (design pass) --- */
/* Visible keyboard focus in brand gold (several buttons removed the default outline). */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #C09B48;
    outline-offset: 2px;
}
/* Every interactive element eases consistently instead of snapping. */
button, a, input, select {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* Header cart badge / icon feedback when something is added to the cart */
@keyframes mgBadgePulse { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes mgIconBounce { 0% { transform: translateY(0); } 30% { transform: translateY(-4px); } 60% { transform: translateY(1px); } 100% { transform: translateY(0); } }
.mg-badge-pulse { animation: mgBadgePulse 0.45s cubic-bezier(.2,.8,.2,1); }
.mg-icon-bounce { animation: mgIconBounce 0.5s ease; }
@media (prefers-reduced-motion: reduce) { .mg-badge-pulse, .mg-icon-bounce { animation: none; } }
