/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg-page: #f6f1ea;
    --color-bg-surface: #fdfbf7;
    --color-bg-surface-alt: #f7f2ec;
    --color-text-body: #2b2622;
    --color-heading: #4a2f2a;
    --color-heading-deep: #3a241f;
    --color-accent-brass: #b08a4a;
    --color-accent-wine: #6e3b3b;
    --color-border: #ddd3c7;
    --color-nav-text: #f6f1ea;
    --color-brand-rgb: 74, 47, 42;
    --shadow-soft: 0 6px 28px rgba(58, 36, 31, 0.07);
    --shadow-elevated: 0 14px 40px rgba(58, 36, 31, 0.1);
    --focus-ring: 0 0 0 3px rgba(176, 138, 74, 0.22);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    line-height: 1.6;
    color: var(--color-text-body);
    background-color: var(--color-bg-page);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-heading);
    color: var(--color-bg-surface);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.4rem;
    color: var(--color-heading);
}

h2 {
    font-size: 2.1rem;
    color: var(--color-heading);
    text-align: center;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.8rem;
    color: var(--color-heading);
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.4rem;
    color: var(--color-heading-deep);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(var(--color-brand-rgb), 0.92);
    backdrop-filter: blur(12px);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h1 {
    color: var(--color-nav-text);
    font-size: 1.8rem;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--color-nav-text);
    text-decoration: none;
    font-weight: 400;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--color-accent-brass);
    outline: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--color-accent-brass);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

/* Language Switcher */
.language-switcher {
    position: relative;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-btn {
    background: transparent;
    border: 1px solid rgba(246, 241, 234, 0.55);
    color: var(--color-nav-text);
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 60px;
    justify-content: center;
}

.language-btn:hover,
.language-btn:focus {
    background: var(--color-bg-surface);
    color: var(--color-heading);
    outline: none;
}

.language-btn[aria-expanded="true"] {
    background: var(--color-bg-surface);
    color: var(--color-heading);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.language-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-bg-surface);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    list-style: none;
    padding: 8px 0;
    margin: 5px 0 0 0;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.language-option {
    display: block;
    padding: 10px 15px;
    color: var(--color-heading);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.language-option:hover,
.language-option:focus {
    background: rgba(176, 138, 74, 0.12);
    color: var(--color-heading-deep);
    outline: none;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--color-nav-text);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Immersive wine hero */
.wine-hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110%;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center;
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.6rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(220, 220, 220, 0.7);
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    white-space: pre;
    transform-origin: center bottom;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.cta-button {
    display: inline-block;
    background: var(--color-accent-brass);
    color: var(--color-heading-deep);
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--color-accent-brass);
    box-shadow: 0 4px 18px rgba(58, 36, 31, 0.12);
}

.cta-button:hover,
.cta-button:focus {
    background: transparent;
    color: var(--color-bg-surface);
    border-color: var(--color-bg-surface);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    outline: none;
}

/* Section Styles */
section {
    padding: 80px 0;
}

.section-title {
    position: relative;
    margin-bottom: 3rem;
    transform-origin: center bottom;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 2px;
    background: var(--color-accent-brass);
    opacity: 0.85;
}

/* About Section */
.about-section {
    background: var(--color-bg-surface-alt);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    color: var(--color-heading);
    margin-bottom: 1.5rem;
}

.about-text h4 {
    color: var(--color-heading-deep);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
}

/* Products Section */
.products-section {
    background: var(--color-bg-surface);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: var(--color-bg-surface-alt);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-elevated);
    border-color: rgba(176, 138, 74, 0.35);
}

.product-image {
    height: 250px;
    overflow: hidden;
    vertical-align: bottom;
}

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

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* GSAP product card base */
.wine-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center center;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    color: var(--color-heading);
    margin-bottom: 0.5rem;
}

.product-year {
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.product-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-accent-brass);
    letter-spacing: 0.02em;
}

/* Location Section */
.location-section {
    background: var(--color-bg-surface-alt);
}

.location-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.location-info h3 {
    color: var(--color-heading);
    margin-bottom: 2rem;
}

.address, .hours, .contact-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-bg-surface);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}

.address h4, .hours h4, .contact-info h4 {
    color: var(--color-heading-deep);
    margin-bottom: 1rem;
}

.directions-button {
    display: inline-block;
    background: var(--color-heading);
    color: var(--color-bg-surface);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 1rem;
    border: 1px solid transparent;
}

.directions-button:hover,
.directions-button:focus {
    background: var(--color-heading-deep);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(58, 36, 31, 0.2);
    outline: none;
}

.map-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
}

.map-container iframe {
    border-radius: 15px;
}

/* Contact Section */
.contact-section {
    background: var(--color-bg-surface);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    color: var(--color-heading);
    margin-bottom: 1.5rem;
}

.contact-details {
    margin-top: 2rem;
}

.contact-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--color-bg-surface-alt);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.contact-item h4 {
    color: var(--color-heading-deep);
    margin-bottom: 0.5rem;
}

/* Form Styles */
.contact-form {
    background: var(--color-bg-surface-alt);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-heading-deep);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--color-bg-surface);
    color: var(--color-text-body);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent-brass);
    box-shadow: var(--focus-ring);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    background: var(--color-heading);
    color: var(--color-bg-surface);
    padding: 15px 30px;
    border: 1px solid var(--color-heading-deep);
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-button:hover,
.submit-button:focus {
    background: var(--color-heading-deep);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(58, 36, 31, 0.22);
    outline: none;
}

.error-message {
    color: #d32f2f;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.form-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Footer */
.footer {
    background: var(--color-heading-deep);
    color: rgba(246, 241, 234, 0.92);
    padding: 3rem 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--color-accent-brass);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(246, 241, 234, 0.88);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover,
.footer-section a:focus {
    color: var(--color-accent-brass);
    outline: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(176, 138, 74, 0.95);
    font-size: 0.95rem;
}

/* RTL Support */
[dir="rtl"] .language-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .language-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .dropdown-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .language-btn[aria-expanded="true"] .dropdown-arrow {
    transform: scaleX(-1) rotate(180deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(var(--color-brand-rgb), 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .language-switcher {
        margin-top: 1rem;
    }

    .language-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }

    .language-menu.show {
        display: block;
    }

    .language-option {
        color: var(--color-nav-text);
        padding: 8px 0;
        border-bottom: 1px solid rgba(246, 241, 234, 0.15);
    }

    .language-option:hover,
    .language-option:focus {
        background: transparent;
        color: var(--color-accent-brass);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .about-content,
    .location-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.8rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    section {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--color-accent-brass);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .navbar {
        background: #000;
    }
    
    .nav-link {
        color: #fff;
    }
    
    .hero-content {
        background: rgba(0, 0, 0, 0.8);
        padding: 2rem;
        border-radius: 10px;
    }
}

/* Product Popup Styles */
.product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

/* Wraps content + close so the X anchors to the real popup box */
.popup-panel {
    position: relative;
    z-index: 10001;
    width: 90%;
    max-width: 900px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.product-popup.active .popup-panel {
    transform: scale(1);
}

.popup-content {
    position: relative;
    background: var(--color-bg-surface);
    border-radius: 20px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    box-shadow: 0 28px 80px rgba(58, 36, 31, 0.18);
}

.popup-close {
    position: absolute;
    /* Outside top-right corner of the popup card */
    top: -14px;
    right: -14px;
    transform: none;
    background: var(--color-heading);
    color: var(--color-bg-surface);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.popup-close:hover,
.popup-close:focus {
    background: var(--color-heading-deep);
    transform: rotate(90deg);
    outline: none;
    box-shadow: 0 6px 20px rgba(58, 36, 31, 0.25);
}

.popup-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    align-items: start;
}

.popup-image-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: var(--color-bg-surface-alt);
    border-radius: 15px;
    /* No top padding so the image lines up with the title (same baseline row as .popup-details) */
    padding: 2rem 2rem 2rem 2rem;
    border: 1px solid var(--color-border);
}

.popup-image-container img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
}

.popup-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.popup-title {
    color: var(--color-heading);
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.popup-details-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.popup-detail-item {
    padding: 1rem;
    background: var(--color-bg-surface-alt);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.popup-detail-item strong {
    display: block;
    color: var(--color-accent-wine);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.popup-detail-item p {
    color: var(--color-text-body);
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

.popup-detail-item.popup-price {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 0 0 1px rgba(176, 138, 74, 0.2), var(--shadow-soft);
}

.popup-detail-item.popup-price strong {
    display: inline;
    margin-right: 0.5rem;
}

.price-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-accent-brass);
    font-family: 'Playfair Display', serif;
}

/* Responsive Popup */
@media (max-width: 768px) {
    .popup-panel {
        width: 95%;
    }

    .popup-content {
        max-height: 95vh;
    }

    .popup-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .popup-image-container {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }

    .popup-image-container img {
        max-height: 300px;
    }

    .popup-title {
        font-size: 1.5rem;
    }

    .popup-close {
        width: 38px;
        height: 38px;
        font-size: 22px;
        top: -8px;
        right: -8px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    #hero-video {
        display: none;
    }
    
    .video-fallback {
        display: flex;
    }

    .product-popup,
    .popup-panel,
    .popup-content {
        transition: none;
    }
}
