:root {
    --primary: #D71920; /* IACC Red */
    --primary-dark: #A51318;
    --secondary: #2D2D2D;
    --background: #F8F9FA;
    --surface: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #666666;
    --white: #FFFFFF;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 45px rgba(215, 25, 32, 0.15);
    --radius: 12px;
    --radius-lg: 20px;
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-logo {
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    line-height: 1;
}

.logo-text span {
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
}

.nav-btn i {
    width: 18px;
    height: 18px;
}

.nav-btn.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(215, 25, 32, 0.3);
}

.nav-btn:hover:not(.active) {
    background: rgba(215, 25, 32, 0.05);
    color: var(--primary);
}

/* Hero Section */
.hero {
    height: 50vh;
    min-height: 400px;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('../assets/img/portadas/Portada_Otros.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
    animation: fadeInUp 1s ease;
}

.hero-tag {
    background: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 1.5rem 0 1rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat span:first-child {
    font-size: 2rem;
    font-weight: 800;
}

.stat span:last-child {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.7;
    letter-spacing: 1px;
}

/* Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Filters */
.filters-section {
    margin: -3rem auto 3rem;
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    z-index: 10;
    position: relative;
}

.filter-group {
    display: flex;
    gap: 1rem;
}

#search-input {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: 1px solid #EEE;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(215, 25, 32, 0.1);
}

#filter-type, #filter-year, #filter-brand, #filter-kit, #sort-by {
    padding: 0.8rem 1.5rem;
    border: 1px solid #EEE;
    border-radius: var(--radius);
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .filter-group {
        flex-wrap: wrap;
    }
    .filter-group > * {
        flex: 1 1 200px;
    }
}

/* Jerseys Grid */
.jerseys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-bottom: 5rem;
}

/* Jersey Card */
.jersey-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.jersey-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-img {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.jersey-card:hover .card-img img {
    transform: scale(1.1);
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.card-content {
    padding: 1.5rem;
}

.card-year {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--surface);
    width: 95%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content.large {
    max-width: 1000px;
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-width {
    grid-column: span 2;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
}

input, select, textarea {
    padding: 0.8rem;
    border: 1px solid #DDD;
    border-radius: var(--radius);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(215, 25, 32, 0.3);
}

.btn-secondary {
    background: #EEE;
    color: var(--text);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
}

.drop-zone {
    border: 2px dashed #DDD;
    padding: 2rem;
    text-align: center;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(215, 25, 32, 0.02);
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Auth Card */
.auth-card {
    max-width: 400px;
    margin: 4rem auto;
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
}

.lock-icon {
    width: 60px;
    height: 60px;
    color: var(--primary);
    margin-bottom: 2rem;
}

.auth-card h3 {
    margin-bottom: 1rem;
}

.auth-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

/* Admin Table */
.jerseys-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.jerseys-table th {
    background: #FAFAFA;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 1px solid #EEE;
}

.jerseys-table td {
    padding: 1rem;
    border-bottom: 1px solid #EEE;
}

.table-jersey-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.table-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

/* Detail View */
.detail-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    height: 100%;
}

.detail-gallery {
    background: #000;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-img-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius);
}

.main-img-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius);
    transition: transform 0.2s ease;
}

.main-img-container.zoomed {
    cursor: zoom-out;
}

.main-img-container.zoomed img {
    transform: scale(2.5);
    max-height: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbs-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
}

.detail-info {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    position: relative;
    overflow-y: auto;
}

.detail-cover {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.detail-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #FFFFFF);
}

.detail-content-wrap {
    padding: 1.5rem 3rem 4rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    margin-top: -1.5rem;
}

.info-tag {
    background: rgba(215, 25, 32, 0.1);
    color: var(--primary);
    padding: 0.4rem 1rem;
    font-weight: 700;
    border-radius: 50px;
    width: fit-content;
    margin-bottom: 1rem;
}

#detail-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--secondary) 20%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    background: var(--background);
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.info-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 1.5px;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.info-item .value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
}

.btn-share {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-share:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(215, 25, 32, 0.2);
    transform: translateY(-2px);
}

.btn-share i {
    width: 20px;
    height: 20px;
}

/* Footer */
footer {
    background: var(--secondary);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 5rem;
}

.footer-logo {
    height: 60px;
    margin-top: 2rem;
    opacity: 0.5;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Nav Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2010;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow.left { left: 2rem; }
.nav-arrow.right { right: 2rem; }

/* Responsive */
@media (max-width: 1100px) {
    .logo-text { display: none !important; }
    .nav-content { padding: 0 1rem; }
    .navbar { padding: 0.5rem 0; }
    .main-logo { height: 45px; }
    .nav-btn { padding: 0.5rem 0.8rem; font-size: 0.9rem; }
}

@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .nav-content { padding: 0 0.75rem; justify-content: space-between; gap: 0.3rem; }
    
    .navbar { padding: 0.4rem 0 !important; }
    .main-logo { height: 32px !important; }
    
    .nav-links { gap: 0.2rem !important; }
    .nav-btn { 
        padding: 0.4rem 0.5rem !important; 
        font-size: 0 !important; 
        min-width: 40px;
        justify-content: center;
    }
    .nav-btn i { width: 22px !important; height: 22px !important; margin: 0 !important; }
    
    .hero { min-height: 300px !important; }
    .hero h2 { font-size: 2rem !important; }
    .hero-tag {
        white-space: nowrap !important;
        font-size: 0.65rem !important;
        padding: 0.3rem 0.6rem !important;
    }

    .filters-section { 
        padding: 0.5rem 0 !important; 
        margin-top: -1.5rem !important; 
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    .filter-group { 
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important; 
        overflow-x: auto;
        padding: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .filter-group::-webkit-scrollbar { display: none; } /* Hide scrollbar for a cleaner look */

    #filter-type, #filter-year, #filter-brand, #filter-kit, #sort-by {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
        min-width: 120px;
        flex: 0 0 auto !important;
        background: white;
        border: 1px solid rgba(0,0,0,0.1);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    /* Fix Detail Modal Mobile - AGGRESSIVE FIX */
    .modal-content.large { width: 98% !important; max-height: 95vh !important; }
    .detail-body { 
        display: flex !important; 
        flex-direction: column !important; 
        height: auto !important; 
    }
    .detail-gallery { 
        width: 100% !important; 
        padding: 1rem !important; 
        height: auto !important; 
        background: #000 !important;
    }
    .main-img-container img { 
        max-height: 50vh !important; 
        object-fit: contain !important; 
    }
    .detail-info { 
        width: 100% !important; 
        height: auto !important; 
        overflow: visible !important; 
    }
    .detail-cover { height: 100px !important; }
    .detail-content-wrap { padding: 1.2rem !important; margin-top: -1rem !important; }
    #detail-name { font-size: 1.4rem !important; margin-bottom: 1rem !important; }
    .info-grid { grid-template-columns: 1fr 1fr !important; gap: 0.75rem !important; margin-bottom: 1.5rem !important; }
    .info-item { padding: 0.8rem !important; }
    .info-item .value { font-size: 1rem !important; }
    
    .nav-arrow { width: 40px !important; height: 40px !important; background: rgba(0,0,0,0.4) !important; }
}
