/* ===== FONTS ===== */
@font-face {
    font-family: 'Marbley';
    src: local('Marbley'),
         url('../fonts/Marbley.otf') format('opentype'), /* relative to /css/styles.css */
         url('/fonts/Marbley.otf') format('opentype'),  /* site-root fallback when deployed */
         url('https://main.thatbrokeclub.pages.dev/fonts/Marbley.otf') format('opentype'); /* absolute fallback */
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Global box-sizing to prevent width overflow from padding/borders */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Hero Title */
.hero h1 {
    font-family: 'Marbley', 'Archivo Black', sans-serif !important;
    font-size: 8rem;
    font-weight: normal !important;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hero Navigation Links */
.hero-nav-link {
    font-family: 'Marbley', 'Archivo Black', sans-serif !important;
    font-size: 2.25rem !important;
    font-weight: normal !important;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: white;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0.8;
    transform: translateX(-20px);
    animation: slideIn 0.6s ease-out forwards;
    display: inline-block;
}

/* Adjust hover and active states */
.hero-nav-link:hover,
.hero-nav-link.active {
    color: white;
    opacity: 1;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    transform: translateX(0) scale(1.05);
}

/* Update responsive styles */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 6rem;
    }
    
    .hero-nav-link {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 4.5rem;
    }
    
    .hero-nav {
        display: none; /* hide desktop nav on mobile in favor of mobile drawer */
    }
    
    /* show hamburger toggle on mobile */
    .mobile-nav-toggle {
        display: block;
    }
    
    .hero-nav-link {
        font-size: 1.5rem;
        margin: 0 0.75rem;
        transform: translateY(20px);
    }
    
    .hero-nav-link:hover,
    .hero-nav-link.active {
        transform: translateY(0) scale(1.05);
    }
}

/* Ensure smooth animations */
@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Landing Hero Layout ===== */
body.landing-page {
    background: #000;
    color: #fff;
}

/* Prevent horizontal overflow globally */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Guard common layout wrappers against horizontal overflow */
.container,
.section,
.hero-content,
.featured-grid {
    overflow-x: hidden;
}

/* Make media responsive by default to avoid horizontal scrolling */
img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

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

.video-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.hero-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 0 0 2.25rem 0;
    padding-top: 0.5rem;
}

.hero-main .tagline {
    margin-top: 0.75rem;
    font-family: 'Archivo', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Hero CTA Buttons */
.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-family: 'Archivo', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    max-width: 100%;
    white-space: normal; /* allow wrapping on small screens */
    word-break: break-word; /* prevent overflow on long words */
    box-sizing: border-box; /* include border/padding in width */
}

/* Larger button variant used in hero */
.btn-lg {
    padding: 1rem 1.75rem;
    font-size: 1rem;
}

.btn-primary {
    background: #000;
    color: white;
    border-color: #000;
}

.btn-primary:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1.25rem;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-checkout {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-family: 'Archivo', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.875rem;
    margin-top: 1rem;
    display: inline-block;
}

.btn-checkout:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Button container adjustments */
    .auth-buttons {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        margin: 1rem 0 0;
        gap: 0.75rem;
    }
    
    /* Base button styles for mobile */
    .btn {
        width: 100%;
        max-width: 100%;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        white-space: normal; /* allow wrapping on narrow screens */
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
        box-sizing: border-box;
    }
    
    /* Specific button types */
    .btn-ghost,
    .btn-checkout,
    .btn-primary,
    .btn-outline {
        width: 100%;
        text-align: center;
        margin: 0.25rem 0;
        max-width: 100%;
    }
    
    /* Hero call-to-action buttons */
    .btn-lg {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 100%;
    }
    
    /* Button container in hero */
    .hero-cta {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }
    /* Force hero/auth buttons to fully fit mobile width */
    .hero-cta .btn,
    .auth-buttons .btn {
        width: 100%;
        max-width: 100%;
        align-self: stretch;
    }
    /* Cap drawer inner widths */
    .landing-page .mobile-nav,
    .landing-page .mobile-nav * {
        max-width: 100%;
    }
    /* Ensure buttons don't grow too large on wider mobile screens */
    @media (min-width: 400px) {
        .hero-cta {
            max-width: 400px;
            margin: 0 auto;
        }
    }
}

/* Extra-small devices: further reduce hero title and ensure wrapping */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.75rem;
        line-height: 1.2;
        padding: 0 1rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .hero .tagline {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    .hero-cta {
        padding: 0 1rem;
    }
    
    /* Prevent long headers from causing overflow */
    .section-header h2 {
        font-size: 2rem;
        word-break: break-word;
        overflow-wrap: anywhere;
        padding: 0 0.5rem;
    }
    
    /* Ensure images and other elements don't cause overflow */
    img, video, iframe {
        max-width: 100%;
        height: auto;
    }
}

/* Update the active state for current page */
.hero-nav-link.active {
    opacity: 1;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none; /* Hidden by default, shown on mobile */
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.hamburger {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* Active state for hamburger */
.mobile-nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobile Navigation */
.landing-page .mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: auto; /* avoid conflicts with header styles */
    width: min(90vw, 320px);
    height: 100vh;
    background: #000;
    padding: 5rem 1.5rem 2rem;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    will-change: transform;
}

.landing-page .mobile-nav.active {
    right: 0;
    left: auto; /* ensure slide-in from right on landing */
    transform: translateX(0);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
}

.landing-page .mobile-nav-link {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Marbley', 'Archivo Black', sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.landing-page .mobile-nav-link:active {
    background: rgba(255, 255, 255, 0.05);
}

.landing-page .mobile-nav-link.active {
    color: #fff;
    font-weight: 600;
}

.landing-page .mobile-auth-buttons {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.landing-page .mobile-auth-buttons .btn-ghost {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
    text-align: center;
}

/* Lock scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
    height: 100vh;
}

/* No generic .overlay to avoid conflicts; hero overlay is above */

/* Responsive styles */
@media (max-width: 768px) {
    .hero-nav {
        display: none; /* use mobile nav */
    }
    
    .landing-page .mobile-nav-toggle {
        display: block;
    }
    /* Tighter hero paddings on mobile */
    .landing-page .hero-content { padding: 3rem 1rem 2rem; }
    .landing-page .hero-cta { gap: 0.75rem; }
    .auth-buttons .btn-checkout {
        display: block;
        margin: 1rem auto 0;
        max-width: 200px;
    }
    
    /* Prevent scrolling when mobile menu is open */
    body.menu-open {
        overflow: hidden;
        height: 100%;
    }
}

/* Hide mobile menu on desktop */
@media (min-width: 1025px) {
    .mobile-nav-toggle,
    .mobile-nav,
    .overlay {
        display: none !important;
    }
    
    .hero-nav {
        display: flex !important;
    }
}

/* Smaller screens adjustments */
@media (max-width: 480px) {
.hero h1 { font-size: 3.25rem; }
.hero-cta { gap: 0.75rem; }
}

/* ===== Base Layout for Landing Sections ===== */
.section {
padding: 4rem 0;
}

.section .container { /* in case nested */
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 1.25rem;
}

.container { /* generic container used throughout */
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 1.25rem;
}

.section-header {
text-align: center;
margin-bottom: 2rem;
}

.section-header h2 {
font-family: 'Marbley', 'Archivo Black', sans-serif;
font-size: 2.5rem;
margin: 0 0 0.5rem 0;
}

.section-header p {
color: #cfcfcf;
margin: 0;
}

/* Featured products grid */
.featured-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
width: 100%;
overflow-x: hidden;
}

@media (max-width: 992px) {
.featured-grid { 
grid-template-columns: repeat(2, 1fr); 
}
}

@media (max-width: 600px) {
.featured-grid { grid-template-columns: 1fr; }
}

.product-card {
background: rgba(255, 255, 255, 0.02);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 8px;
overflow: hidden;
min-width: 0; /* allow grid item to shrink without causing overflow */
}

.product-image {
width: 100%;
height: 320px;
object-fit: cover;
display: block;
}

.product-info {
padding: 1rem;
}

.product-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.product-info .price { color: #9be37f; font-weight: 600; }

.add-to-cart {
margin-top: 0.75rem;
width: 100%;
background: #0d6efd;
color: #fff;
border: 0;
padding: 0.5rem 0.75rem;
border-radius: 4px;
cursor: pointer;
box-sizing: border-box;
}

/* Product badges */
.product-badge {
position: absolute;
top: 10px;
left: 10px;
background: #ff4d4f;
color: #fff;
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
border-radius: 4px;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.product-badge.featured { background: #6f42c1; }
.product-badge.new { background: #20c997; }

/* About section */
.about-grid {
display: grid;
grid-template-columns: 1.1fr 0.9fr;
gap: 2rem;
align-items: center;
}

@media (max-width: 900px) {
.about-grid { grid-template-columns: 1fr; }
}

.about-content h2 {
font-family: 'Marbley', 'Archivo Black', sans-serif;
font-size: 2rem;
margin: 0 0 0.75rem 0;
}

.about-content p { color: #d0d0d0; margin-bottom: 1rem; }

.about-image {
min-height: 280px;
background: url('/images/about-placeholder.jpg') center/cover no-repeat, rgba(255,255,255,0.05);
border-radius: 8px;
}

/* Newsletter */
.newsletter-section { background: rgba(255,255,255,0.03); }
.newsletter-form {
margin-top: 1rem;
display: inline-flex;
gap: 0.5rem;
}

.newsletter-form input[type="email"] {
background: rgba(0,0,0,0.4);
border: 1px solid rgba(255,255,255,0.15);
color: #fff;
padding: 0.6rem 0.75rem;
border-radius: 4px;
min-width: 240px;
}

.newsletter-form .btn-primary { padding: 0.6rem 0.9rem; }

/* Footer */
.site-footer {
background: #0b0b0b;
border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-content {
display: grid;
grid-template-columns: 1fr 2fr auto;
gap: 2rem;
align-items: start;
padding: 2rem 0;
}

.footer-logo { font-family: 'Marbley', 'Archivo Black', sans-serif; font-size: 1.75rem; }

.footer-links { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 1.25rem; }
.footer-column h4 { margin: 0 0 0.5rem 0; font-size: 1rem; }
.footer-column a { color: #cfcfcf; text-decoration: none; display: block; padding: 0.25rem 0; }
.footer-column a:hover { color: #fff; }

.footer-social a { color: #fff; margin-right: 0.75rem; font-size: 1.1rem; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 1rem 0; text-align: center; color: #cfcfcf; }

@media (max-width: 900px) {
    .footer-content { grid-template-columns: 1fr; }
    .footer-links { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

@media (max-width: 500px) {
    .newsletter-form { display: flex; flex-direction: column; align-items: stretch; }
    .newsletter-form input[type="email"], .newsletter-form .btn-primary { width: 100%; }
    .footer-links { grid-template-columns: 1fr; }
}

/* ===== Auth Modal ===== */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: grid;
    place-items: center;
    z-index: 10010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.auth-modal-overlay[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal {
    width: min(520px, calc(100% - 2rem));
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    color: #fff;
    position: relative;
    max-height: 90vh;
    overflow: auto;
}

.auth-modal-header {
    padding: 1rem 1rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-modal-header h3 {
    margin: 0;
    font-family: 'Marbley', 'Archivo Black', sans-serif;
    letter-spacing: 0.5px;
}

.auth-switch { display: flex; gap: 0.5rem; }

.auth-tab {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
}

.auth-tab[aria-selected="true"] {
    background: #0d6efd;
    border-color: #0d6efd;
}

.auth-modal-body { padding: 1rem; }

.auth-form { display: grid; gap: 0.75rem; }

.auth-form label { display: grid; gap: 0.4rem; font-size: 0.95rem; }

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
}

.auth-hint { color: #cfcfcf; font-size: 0.9rem; text-align: center; margin: 0.25rem 0 0; }
.auth-hint a { color: #fff; text-decoration: underline; }

.auth-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 420px) {
    .auth-modal { width: calc(100% - 1.5rem); }
}