/* ============================================
   CUSTOM STYLES
   Supplementary CSS for features not covered by Tailwind
   ============================================ */

/* CSS Variables for Theme Colors */
:root {
    --background: hsl(40, 33%, 96%);
    --foreground: hsl(220, 15%, 18%);
    --card: hsl(40, 30%, 98%);
    --card-foreground: hsl(220, 15%, 18%);
    --primary: hsl(38, 65%, 50%);
    --primary-foreground: hsl(40, 33%, 98%);
    --secondary: hsl(35, 25%, 90%);
    --secondary-foreground: hsl(220, 15%, 18%);
    --muted: hsl(35, 20%, 93%);
    --muted-foreground: hsl(220, 10%, 46%);
    --accent: hsl(38, 45%, 42%);
    --accent-foreground: hsl(40, 33%, 98%);
    --border: hsl(35, 20%, 88%);
    --gold: hsl(38, 65%, 50%);
    --gold-light: hsl(38, 55%, 70%);
    --gold-dark: hsl(38, 70%, 35%);
    --cream: hsl(40, 33%, 96%);
    --cream-dark: hsl(35, 25%, 90%);
    --charcoal: hsl(220, 15%, 18%);
    --charcoal-light: hsl(220, 10%, 30%);
}

.dark {
    --background: hsl(220, 20%, 8%);
    --foreground: hsl(40, 20%, 90%);
    --card: hsl(220, 18%, 12%);
    --card-foreground: hsl(40, 20%, 90%);
    --primary: hsl(38, 65%, 55%);
    --primary-foreground: hsl(220, 20%, 8%);
    --secondary: hsl(220, 15%, 16%);
    --secondary-foreground: hsl(40, 20%, 90%);
    --muted: hsl(220, 15%, 16%);
    --muted-foreground: hsl(35, 15%, 55%);
    --accent: hsl(38, 50%, 48%);
    --accent-foreground: hsl(220, 20%, 8%);
    --border: hsl(220, 15%, 18%);
    --gold: hsl(38, 65%, 55%);
    --gold-light: hsl(38, 50%, 65%);
    --gold-dark: hsl(38, 70%, 40%);
    --cream: hsl(40, 15%, 15%);
    --cream-dark: hsl(220, 15%, 12%);
    --charcoal: hsl(40, 20%, 90%);
    --charcoal-light: hsl(40, 15%, 70%);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', Georgia, serif;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Theme Transition */
* {
    transition-property: background-color, color, border-color;
    transition-duration: 300ms;
    transition-timing-function: ease;
}

/* Remove transition from transform and opacity for animations */
.animate-on-scroll,
.hero-content,
.group img {
    transition-property: opacity, transform, background-color, color, border-color;
}

/* Custom Animations */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounce-slow {

    0%,
    100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-fade-up {
    animation: fade-up 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-bounce-slow {
    animation: bounce-slow 2s infinite;
}

/* Backdrop Blur Fallback */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* Focus Styles for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Image Loading Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent layout shift during image load */
img[loading="lazy"] {
    min-height: 200px;
    background: var(--muted);
}

/* Custom Utilities */
.text-balance {
    text-wrap: balance;
}

/* Mobile Menu Animation */
#mobile-menu {
    animation: fade-up 0.3s ease-out;
}

/* Hero Content Animation */
.hero-content {
    transition: opacity 1s ease, transform 1s ease;
}

/* Product Card Hover Effects */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

.group:hover .group-hover\:translate-y-0 {
    transform: translateY(0);
}

.group:hover .group-hover\:bg-foreground\/10 {
    background-color: rgba(0, 0, 0, 0.1);
}

.dark .group:hover .group-hover\:bg-foreground\/10 {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Gradient Overlays */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.bg-gradient-to-t {
    background-image: linear-gradient(to top, var(--tw-gradient-stops));
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Print Styles */
@media print {

    nav,
    footer,
    button {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --gold: hsl(38, 100%, 40%);
        --foreground: hsl(0, 0%, 0%);
        --background: hsl(0, 0%, 100%);
    }

    .dark {
        --gold: hsl(38, 100%, 60%);
        --foreground: hsl(0, 0%, 100%);
        --background: hsl(0, 0%, 0%);
    }
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 2rem;
        line-height: 1.3;
    }
}

/* Container Max Width */
.container {
    max-width: 1400px;
}

/* Aspect Ratio Fallback for older browsers */
@supports not (aspect-ratio: 1) {
    .aspect-\[3\/4\] {
        padding-bottom: 133.33%;
        position: relative;
    }

    .aspect-\[3\/4\] img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .aspect-\[16\/10\] {
        padding-bottom: 62.5%;
        position: relative;
    }

    .aspect-\[16\/10\] img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Newsletter Input Focus */
#newsletter-email:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(var(--gold), 0.1);
}

/* Button Hover States */
button,
a.inline-flex {
    position: relative;
    overflow: hidden;
}

button::before,
a.inline-flex::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before,
a.inline-flex:hover::before {
    width: 300px;
    height: 300px;
}

/* Card Shadow on Hover */
.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5),
        0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* ============================================
   ENHANCED NAVBAR STYLES
   ============================================ */

/* Logo Enhancements */
.logo-link {
    position: relative;
}

.logo-icon {
    box-shadow: 0 4px 14px 0 rgba(218, 165, 32, 0.4);
}

.logo-link:hover .logo-icon {
    box-shadow: 0 6px 20px 0 rgba(218, 165, 32, 0.6);
}

/* Desktop Navigation Link Enhancements */
.nav-link-enhanced {
    position: relative;
    text-transform: capitalize;
    letter-spacing: 0.05em;
}

.nav-link-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 0;
}

.nav-link-enhanced:hover::before {
    width: 100%;
    height: 100%;
}

/* Gradient Underline Animation */
.nav-underline {
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.4);
}

/* Icon Button Enhancements */
.nav-icon-btn {
    position: relative;
    backdrop-filter: blur(4px);
}

.nav-icon-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(218, 165, 32, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-icon-btn:hover::after {
    opacity: 1;
}

/* Cart Badge Pulse Animation */
@keyframes pulse-subtle {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(218, 165, 32, 0);
    }
}

.animate-pulse-subtle {
    animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.cart-badge {
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
}

/* Mobile Menu Enhancements */
.mobile-nav-link {
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom,
            hsl(38, 55%, 70%),
            hsl(38, 65%, 50%),
            hsl(38, 70%, 35%));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mobile-nav-link:hover::before {
    transform: scaleY(1);
}

/* Scrolled Navbar State */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.dark #navbar.scrolled {
    background: rgba(34, 34, 34, 0.95) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Scrolled state - Logo adjustments */
#navbar.scrolled .logo-link .logo-icon {
    box-shadow: 0 2px 10px 0 rgba(218, 165, 32, 0.3);
}

#navbar.scrolled .logo-link span:first-of-type {
    color: hsl(220, 15%, 18%);
}

.dark #navbar.scrolled .logo-link span:first-of-type {
    color: hsl(40, 20%, 90%);
}

/* Scrolled state - Nav links */
#navbar.scrolled .nav-link-enhanced {
    color: rgba(34, 34, 34, 0.85);
}

#navbar.scrolled .nav-link-enhanced:hover {
    color: hsl(220, 15%, 18%);
}

.dark #navbar.scrolled .nav-link-enhanced {
    color: rgba(255, 255, 255, 0.85);
}

.dark #navbar.scrolled .nav-link-enhanced:hover {
    color: hsl(40, 20%, 90%);
}

/* Scrolled state - Icon buttons */
#navbar.scrolled .nav-icon-btn {
    color: hsl(220, 15%, 18%);
}

#navbar.scrolled .nav-icon-btn:hover {
    color: hsl(38, 65%, 50%);
    background: rgba(218, 165, 32, 0.1);
}

.dark #navbar.scrolled .nav-icon-btn {
    color: hsl(40, 20%, 90%);
}

.dark #navbar.scrolled .nav-icon-btn:hover {
    color: hsl(38, 65%, 55%);
    background: rgba(218, 165, 32, 0.15);
}

/* Enhanced backdrop blur support */
@supports (backdrop-filter: blur(20px)) {
    #navbar.scrolled {
        backdrop-filter: blur(20px) saturate(180%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-link .logo-icon {
        width: 2.25rem;
        height: 2.25rem;
    }

    .logo-link .logo-icon svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .logo-link span:first-of-type {
        font-size: 1.5rem;
    }

    .logo-link span:last-of-type {
        font-size: 8px;
    }
}

/* Accessibility - Focus states */
.nav-link-enhanced:focus-visible,
.nav-icon-btn:focus-visible,
.mobile-nav-link:focus-visible {
    outline: 2px solid hsl(38, 65%, 50%);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .logo-icon,
    .nav-link-enhanced,
    .nav-icon-btn,
    .mobile-nav-link,
    .cart-badge {
        transition: none !important;
        animation: none !important;
    }

    .nav-underline {
        transition: width 0.1s linear !important;
    }
}