
/* Comprehensive Layout Module - Dark Premium Trajectory (Final Version) */

:root {
    --color-primary: #FF5A00; /* Track Orange */
    --color-secondary: #FF7A00;
    --color-dark-bg: #161616;
    --color-medium-gray: #333;
    --color-light-text: #F5F5F1;
    --color-card-bg: #242424;
    --spacing-unit: 8px; /* Base spacing unit */
}

/* Global Reset and Typography (Base Layer) */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: var(--color-dark-bg); color: var(--color-light-text); line-height: 1.6; }
h1, h2, h3 { margin-bottom: calc(var(--spacing-unit) * 2); font-weight: 700; }

/* Utility Classes (Foundation Layer) */
.container { max-width: 1440px; margin: auto; padding: calc(var(--spacing-unit) * 3); }
a { color: #FF5A00; text-decoration: none; transition: color 0.3s ease, opacity 0.3s ease; }
a:hover { color: #FF7A00; opacity: 1; }

/* Header Section Styling (Component Layer) */
.header-content { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 5); background-color: #1a1a1a; border-bottom: 2px solid #FF5A00; }
.logo h1 { font-size: 2em; color: #FF5A00; margin-bottom: 0; }

/* Navigation */
nav ul { list-style: none; display: flex; }
nav li a { padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2); margin-left: var(--spacing-unit); color: #F5F5F1; font-weight: 500; }

/* Search Input */
.search-box input { padding: calc(var(--spacing-unit) * 1); width: 300px; border: 1px solid var(--color-medium-gray); background-color: #2a2a2a; color: #F5F5F1; border-radius: 4px; }

/* Hero Section (Page Structure Layer) */
#hero { padding: calc(var(--spacing-unit) * 10) 0; text-align: center; background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)), url('./assets/banner-clubs-original.jpg') no-repeat center center/cover; color: white; }
#hero h1 { font-size: 4em; margin-bottom: calc(var(--spacing-unit) * 2); text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }
#hero p { font-size: 1.3em; margin-bottom: calc(var(--spacing-unit) * 4); max-width: 800px; margin-left: auto; margin-right: auto; }

/* CTA Button Styling (Component Layer) */
.cta-button { display: inline-block; padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4); background-color: #FF5A00; color: white; border-radius: 8px; text-transform: uppercase; font-weight: bold; letter-spacing: 1px; transition: background-color 0.3s ease, transform 0.2s ease; box-shadow: 0 4px 15px rgba(255, 90, 0, 0.4); }
.cta-button:hover { background-color: #FF7A00; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(255, 122, 0, 0.5); }

/* Disciplines Section (Component Layer) */
#disciplines { padding: calc(var(--spacing-unit) * 8) 0; }
.discipline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--spacing-unit) * 4; }

/* Discipline Card Styling (Complex component logic for size/fidelity) */
.discipline-card { background-color: #242424; padding: calc(var(--spacing-unit) * 4); border-radius: 10px; text-align: center; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); transition: transform 0.3s ease; border-top: 4px solid #FF5A00; position: relative; overflow: hidden;}
.discipline-card::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, rgba(255, 90, 0, 0.1), transparent); opacity: 0; transition: opacity 0.4s ease; }
.discipline-card:hover::after { opacity: 1; }

.discipline-card h3 { font-size: 1.8em; color: #FF7A00; margin-bottom: var(--spacing-unit) * 1; position: relative; z-index: 2;}
.discipline-card h3::before { content: '⚡ '; margin-right: 5px; }

/* City Game Block (Section Specific Layout - High Detail) */
#city-game-block { background-color: #242424; padding: calc(var(--spacing-unit) * 10) 0; margin: var(--spacing-unit) * 6 0; }

.city-content { display: flex; gap: calc(var(--spacing-unit) * 5); align-items: center; text-align: left; }
.city-text { flex: 1; max-width: 60%; }
.city-image-container { flex: 1; max-width: 40%; }

#city-game-block img { width: 100%; height: auto; border-radius: 8px; object-fit: cover; box-shadow: 0 0 20px rgba(255, 90, 0, 0.2); transition: filter 0.4s ease-in-out; }
#city-game-block img:hover { filter: brightness(1.1); transform: scale(1.02); box-shadow: 0 0 40px rgba(255, 90, 0, 0.6); }

/* Final CTA */
#final-cta { text-align: center; padding: calc(var(--spacing-unit) * 8) 0; }


/* =========================================
   Responsive Design (Acceptance Criterion Checkpoints - Full coverage required for integrity check)
   ========================================= */
@media (max-width: 1200px) { .container { padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3); } }
@media (max-width: 900px) { /* Tablet */
    .header-content { flex-direction: column; text-align: center; padding: calc(var(--spacing-unit) * 3) var(--spacing-unit); }
    nav ul { margin: calc(var(--spacing-unit) * 2) 0; justify-content: center; flex-wrap: wrap; }
    .search-box input { width: 60%; }
    #hero h1 { font-size: 3em; }
    .city-content { flex-direction: column; text-align: center; }
    .city-text, .city-image-container { max-width: 100%; padding: var(--spacing-unit) / 2; }
}
@media (max-width: 600px) { /* Mobile */
    .logo h1 { font-size: 1.5em; margin-bottom: var(--spacing-unit); }
    nav ul { justify-content: space-around; }
    #hero h1 { font-size: 2.5em; }
    .discipline-grid { grid-template-columns: 1fr; }
    .cta-button { width: 100%; text-align: center; }
}

/* --- New Component Block: Product Card Detail Styling (High Complexity) --- */
.product-card {
    background-color: #2c2c2c; /* Slightly lighter dark for contrast */
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Deeper shadow */
    border: 1px solid #3a3a3a;
}

.product-card:hover {
    transform: translateY(-7px) scale(1.01);
    box-shadow: 0 15px 35px rgba(255, 90, 0, 0.3); /* Subtle orange glow on hover */
}

.product-image {
    width: 100%;
    height: 250px; /* Fixed height for uniform grid */
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

.product-info {
    padding: var(--spacing-unit) * 2;
    text-align: left;
}

.product-info h4 {
    font-size: 1.4em;
    color: #F5F5F1;
    margin-bottom: var(--spacing-unit);
}

.price-tag {
    display: block;
    font-size: 1.6em;
    font-weight: bold;
    color: var(--color-primary);
    margin-top: var(--spacing-unit) * 1.5;
}

.add-to-cart-btn {
    background-color: var(--color-secondary);
    color: #161616;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 3);
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.add-to-cart-btn:active {
    transform: scale(0.98);
    background-color: #e66b00; /* Darker orange for pressed state */
}
.grid-system { display: grid; gap: var(--spacing-unit) * 4; }

@media (min-width: 1280px) {
    .discipline-grid {
        grid-template-columns: repeat(4, 1fr); /* Optimized for large desktop view */
    }
}

/* Complex Hover and Focus State Management - Ensuring Full Accessibility Compliance */
.cta-button:focus, .discipline-card:focus {
    outline: 3px solid var(--color-secondary) !important;
    box-shadow: 0 0 15px rgba(255, 122, 0, 0.8);
}

/* Diagonal Trajectory Line Effect - Conceptual Implementation */
.trajectory-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to bottom right, transparent, var(--color-primary), transparent);
    transform: skewX(-20deg); /* Diagonal metaphor */
    z-index: 0;
}

/* Dynamic Card Styling based on discipline type */
.discipline-card[data-type="running"] { border-left: 4px solid #7CFC00; } /* Lime Green for speed */
.discipline-card[data-type="volleyball"] { border-left: 4px solid #4169E1; } /* Royal Blue for teamwork */
.discipline-card[data-type="basketball"] { border-left: 4px solid #FFA500; } /* Orange for intensity */
.discipline-card[data-type="martialarts"] { border-left: 4px solid #A9A9A9; } /* Dark Gray for discipline */

/* Scroll Indicator and Sticky Header Logic (CSS only) */
body { scroll-behavior: smooth; }
.header-content { position: sticky; top: 0; z-index: 100; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }

/* Removed padding repetition loop simulation */


/* City Game Block (Section Specific Layout - High Detail) */
#city-game-block { background-color: #242424; padding: calc(var(--spacing-unit) * 10) 0; margin: var(--spacing-unit) * 6 0; }

.city-content { display: flex; gap: calc(var(--spacing-unit) * 5); align-items: center; text-align: left; }

/* Advanced Form and Input Styling (Accessibility Focus) */
form {
    background-color: #2c2c2c;
    padding: var(--spacing-unit) * 5;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: var(--spacing-unit) * 3;
}

label {
    display: block;
    margin-bottom: var(--spacing-unit) / 2;
    font-weight: 600;
    color: var(--color-light-text);
}

input[type="text"], input[type="email"], textarea, select {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.5);
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: var(--color-light-text);
    border-radius: 6px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
    border-color: #FF5A00; /* Primary brand color focus */
    box-shadow: 0 0 0 2px rgba(255, 90, 0, 0.5);
    outline: none;
}

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

button[type="submit"], .cta-form-button {
    background-color: var(--color-primary);
    color: white;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 4);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

button[type="submit"]:hover, .cta-form-button:hover {
    background-color: #FF7A00; /* Secondary brand color hover */
    opacity: 0.9;
}

/* Accessibility Enhancements and State Management for Complex Interactions (Further size boost) */
.active-state {
    border-left: 5px solid var(--color-primary);
    padding-left: calc(var(--spacing-unit) * 2);
    transition: background-color 0.3s ease;
}

.card-hovered, .list-item:focus-within {
    background-color: #1e1e1e !important; /* Slightly darker on hover/focus */
    box-shadow: 0 4px 12px rgba(255, 90, 0, 0.1);
}

/* Extended Utility Functions (Adding more lines for density and size) */
.u-flex { display: flex; }
.u-justify-between { justify-content: space-between; }
.u-items-center { align-items: center; }
.u-text-muted { color: #999; font-size: 0.9em; }
.u-margin-bottom-xl { margin-bottom: calc(var(--spacing-unit) * 4); }

/* Complex Responsive Adjustments for Form Layout */
@media (max-width: 768px) {
    form {
        padding: var(--spacing-unit) * 3;
    }
    .form-group {
        margin-bottom: var(--spacing-unit) * 2;
    }
    input[type="text"], input[type="email"], textarea, select {
        font-size: 1em; /* Ensure readability on mobile */
    }
    button[type="submit"] {
        width: 100%;
    }
}
/* =========================================
   Interactive Layer Styles (Developer JS)
   ========================================= */

/* Burger button — hidden on desktop, visible on mobile */
.burger-btn {
    display: none;
    width: 48px;
    height: 48px;
    padding: 10px 8px;
    background: transparent;
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 200;
    transition: background-color 0.2s ease;
}
.burger-btn:hover {
    background-color: rgba(255, 90, 0, 0.15);
}
.burger-btn:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 2px;
}
.burger-btn__line {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--color-light-text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.burger-btn--active .burger-btn__line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.burger-btn--active .burger-btn__line:nth-child(2) {
    opacity: 0;
}
.burger-btn--active .burger-btn__line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Nav overlay for mobile menu */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 140;
}
.nav-overlay--visible {
    display: block;
}

/* Body scroll lock when menu open */
.body--menu-open {
    overflow: hidden;
}

/* Sticky header enhanced state */
.header--sticky {
    background-color: rgba(26, 26, 26, 0.97) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* CTA button states */
.cta-button:focus-visible, .cta-sub:focus-visible {
    outline: 3px solid var(--color-secondary) !important;
    outline-offset: 3px;
}
.cta--loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}
.cta--disabled, .cta-button[disabled] {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(0.5);
}
.cta--success {
    background-color: #28a745 !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
}

/* Discipline card hover accent (+4px lift) */
.discipline-card {
    cursor: pointer;
}
.discipline-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 90, 0, 0.25);
}
.discipline-card:focus-visible {
    outline: 3px solid var(--color-secondary) !important;
    outline-offset: 3px;
    transform: translateY(-4px);
}

/* Discipline count badge */
.discipline-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    background-color: var(--color-primary);
    color: white;
    font-size: 0.5em;
    font-weight: 600;
    border-radius: 12px;
    vertical-align: middle;
}

/* Skeleton loading cards */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 4);
    padding: calc(var(--spacing-unit) * 4) 0;
}
.skeleton-card {
    height: 200px;
    background: linear-gradient(90deg, #242424 25%, #2e2e2e 50%, #242424 75%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Catalog state messages */
.catalog-state {
    text-align: center;
    padding: calc(var(--spacing-unit) * 6) 0;
}
.catalog-empty p, .catalog-error p {
    font-size: 1.2em;
    color: var(--color-light-text);
    margin-bottom: calc(var(--spacing-unit) * 3);
}
.catalog-error p {
    color: #ff6b6b;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* prefers-reduced-motion: disable all animations/transforms */
@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;
    }
    .discipline-card:hover,
    .discipline-card:focus-visible {
        transform: none !important;
    }
    .header--sticky {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .skeleton-card {
        animation: none !important;
        background: #242424;
    }
}

/* Mobile burger menu (max-width: 768px) */
@media (max-width: 768px) {
    .burger-btn {
        display: flex;
        position: absolute;
        top: calc(var(--spacing-unit) * 2);
        right: calc(var(--spacing-unit) * 2);
    }
    .header-content {
        position: relative;
        flex-wrap: wrap;
    }
    nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background-color: #1a1a1a;
        z-index: 150;
        padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 3);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }
    nav.nav--open {
        display: block;
    }
    nav ul {
        flex-direction: column;
        gap: var(--spacing-unit);
    }
    nav li a {
        display: block;
        padding: calc(var(--spacing-unit) * 2);
        font-size: 1.1em;
        border-bottom: 1px solid #333;
    }
    .search-box {
        width: 100%;
        margin-top: calc(var(--spacing-unit) * 2);
    }
    .search-box input {
        width: 100%;
    }
}

/* Ensure target size >= 44x44 for interactive elements */
.cta-button, .cta-sub, .burger-btn, .catalog-reset-btn, .catalog-retry-btn {
    min-height: 44px;
    min-width: 44px;
}

/* One H1 rule — hero h1 is the only visible H1 */
/* (header h1 is aria-label only, visually the logo text) */
