@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg: #f4f4f1;
    --bg-alt: #ecece7;
    --surface: #efefeb;
    --surface-2: #e8e8e3;
    --ink: #171717;
    --muted: #666662;
    --line: #c9c9c1;
    --line-strong: #a7a79f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    background:
        linear-gradient(180deg, #f7f7f5 0%, #f0f0ec 55%, #e9e9e4 100%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.015) 0 1px, transparent 1px 140px);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px;
}

/* Header */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(243, 243, 239, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
}

.navbar {
    padding: 0;
}

.navbar .container {
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 1.2rem;
    margin: 0;
}

.nav-menu a {
    color: var(--ink);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    font-size: 0.86rem;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.nav-menu a:hover,
.nav-menu a.active {
    border-bottom-color: var(--ink);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--ink);
}

.hamburger span {
    width: 20px;
    height: 2px;
    background-color: var(--ink);
    transition: all 0.3s ease;
}

/* Hero + carousel */
.hero {
    margin-top: 72px;
    position: relative;
    background-color: var(--bg-alt);
    border-bottom: 1px solid var(--line);
}

.carousel {
    position: relative;
    width: 100%;
    height: min(65vh, 600px);
    min-height: 380px;
    overflow: hidden;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: none;
    aspect-ratio: 3 / 4;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: grayscale(0.08) contrast(1.04);
}

.carousel-caption {
    position: absolute;
    left: 5%;
    bottom: 8%;
    color: var(--ink);
    background: rgba(239, 239, 235, 0.94);
    border: 1px solid var(--line-strong);
    width: min(560px, 90%);
    padding: 18px 20px;
}

.carousel-caption h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.35rem, 2.4vw, 2.2rem);
    line-height: 1.1;
    margin-bottom: 8px;
}

.carousel-caption p {
    font-size: 0.98rem;
    color: var(--muted);
    margin: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.86);
    color: #f7f7f5;
    border: 1px solid #141414;
    padding: 0.68rem 0.95rem;
    cursor: pointer;
    font-size: 1.05rem;
    z-index: 10;
}

.carousel-btn.prev {
    left: 14px;
}

.carousel-btn.next {
    right: 14px;
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 18px;
    height: 3px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.dot.active {
    background: #ffffff;
}

/* Section shared */
.page-section {
    margin-top: 72px;
    min-height: calc(100vh - 72px);
}

.section-ligas,
.section-selecciones,
.section-contacto,
.categories-section,
.features-section {
    padding: 3.8rem 0;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    text-align: left;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--ink);
    margin-bottom: 2.1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-title::after {
    content: '';
    display: block;
    width: 90px;
    height: 2px;
    background-color: var(--ink);
    margin-top: 10px;
}

/* Intro paragraphs with inline styles */
.section-ligas .container > p[style],
.section-selecciones .container > p[style],
.section-contacto .container > p[style] {
    text-align: left !important;
    color: var(--muted) !important;
    font-size: 1rem !important;
    margin-bottom: 1.6rem !important;
    max-width: 65ch;
}

/* Index category + features */
.categories-section {
    background: transparent;
    border-bottom: 1px solid var(--line);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    display: block;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 28px 24px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.category-card:nth-child(even) {
    margin-top: 42px;
}

.category-card:hover {
    border-color: var(--ink);
    transform: translateY(-4px);
}

.category-icon {
    font-size: 2.3rem;
    color: var(--ink);
    margin-bottom: 1rem;
}

.category-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.category-card p {
    color: var(--muted);
    margin-bottom: 0.9rem;
}

.category-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--ink);
}

.features-section {
    background: var(--surface-2);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 22px;
    min-height: 210px;
}

.feature-card i {
    font-size: 1.75rem;
    margin-bottom: 0.8rem;
    color: var(--ink);
}

.feature-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 2rem;
    border: 1px solid var(--line);
    padding: 10px;
    background: var(--surface);
}

.filter-btn {
    padding: 0.6rem 1rem;
    background-color: transparent;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--ink);
    border-color: var(--ink);
    color: #f6f6f3;
}

/* Jerseys */
.jerseys-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.jersey-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: transform 0.24s ease;
    animation: fadeIn 0.45s ease-in-out;
}

.jersey-card:nth-child(3n + 2) {
    margin-top: 28px;
}

.jersey-card:hover {
    transform: translateY(-4px);
}

.jersey-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 290px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jersey-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    display: block;
    flex-shrink: 0;
}

.jersey-card:hover .jersey-image img {
    transform: scale(1.04);
}

.jersey-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(14, 14, 14, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.jersey-card:hover .jersey-overlay {
    opacity: 1;
}

.quick-view-btn {
    background-color: #f6f6f3;
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 0.62rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.jersey-info {
    padding: 14px;
}

.league-badge,
.league-badge[style] {
    display: inline-block;
    background-color: var(--ink) !important;
    color: #f4f4ef;
    border: 1px solid var(--ink);
    padding: 0.22rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.jersey-info h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    color: var(--ink);
    margin: 0.2rem 0 0.4rem;
}

.price {
    font-size: 1.12rem;
    color: var(--ink);
    font-weight: 700;
    margin: 0.25rem 0 0.7rem;
}

.order-btn {
    width: 100%;
    padding: 0.72rem 0.75rem;
    background-color: var(--ink);
    color: #f4f4ef;
    border: 1px solid var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-btn:hover {
    background-color: #000;
    border-color: #000;
}

.order-btn i {
    font-size: 1rem;
}

.jersey-card.hidden {
    display: none !important;
}

/* Contact */
.section-contacto {
    background: transparent;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 16px;
    align-items: start;
}

.contact-info,
.contact-form-wrapper {
    border: 1px solid var(--line);
    background: var(--surface);
}

.contact-info {
    color: var(--ink);
    padding: 20px;
}

.contact-info h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1.2rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    color: var(--muted);
}

.info-item i {
    font-size: 1.1rem;
    color: var(--ink);
}

.contact-form-wrapper {
    padding: 20px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.4rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
    padding: 0.85rem;
    border: 1px solid var(--line-strong);
    background: #f8f8f5;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--ink);
}

.submit-btn {
    padding: 0.85rem;
    background-color: var(--ink);
    color: #f5f5f1;
    border: 1px solid var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.submit-btn:hover {
    background-color: #000;
}

/* Footer */
.footer {
    background-color: var(--surface-2);
    color: var(--ink);
    border-top: 1px solid var(--line);
    padding: 2.4rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 1.5rem;
}

.footer-section h3,
.footer-section h4 {
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 0.9rem;
    font-size: 1.06rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p {
    color: var(--muted);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.42rem;
}

.footer-section ul li a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.footer-section ul li a:hover {
    border-bottom-color: var(--ink);
}

.social-links {
    display: flex;
    gap: 0.6rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background-color: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
    text-decoration: none;
}

.social-links a:hover {
    background-color: var(--ink);
    color: #f5f5f1;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

/* Modal overrides for Bootstrap */
.modal-content {
    border: 1px solid var(--line-strong);
    border-radius: 0;
    background: #f4f4f1;
    color: var(--ink);
}

.modal-header,
.modal-header[style] {
    background: var(--surface) !important;
    color: var(--ink) !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 1rem 1.2rem;
}

.modal-body {
    padding: 1.2rem;
}

.modal-footer,
.modal-footer[style] {
    border-top: 1px solid var(--line) !important;
    padding: 1rem 1.2rem;
}

#modalJerseyName,
#modalJerseyName[style] {
    color: var(--ink) !important;
}

#modalJerseyPrice,
#modalJerseyPrice.text-success {
    color: var(--ink) !important;
}

.alert,
.alert-info {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}

.badge,
.badge.bg-secondary {
    background-color: #d8d8d1 !important;
    color: var(--ink) !important;
    border-radius: 0;
}

.btn,
.btn-success,
.btn-secondary {
    border-radius: 0;
}

.btn-success,
#modalOrderBtn,
#modalOrderBtn[style] {
    background-color: var(--ink) !important;
    border-color: var(--ink) !important;
}

.modal-gallery {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-gallery img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--line);
}

.modal-gallery img.active {
    border-color: var(--ink);
}

/* Card carousel in listings */
.jersey-image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.jersey-carousel-images {
    display: flex;
    transition: transform 0.4s ease-in-out;
    height: 100%;
    width: 100%;
}

.jersey-carousel-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex: 0 0 100%;
}

.jersey-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(20, 20, 20, 0.84);
    color: #f5f5f2;
    border: 1px solid #111;
    padding: 0.4rem 0.54rem;
    cursor: pointer;
    font-size: 0.82rem;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.jersey-card:hover .jersey-carousel-btn {
    opacity: 1;
}

.jersey-carousel-btn.prev-jersey {
    left: 6px;
}

.jersey-carousel-btn.next-jersey {
    right: 6px;
}

.jersey-carousel-indicators {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 5;
}

.jersey-indicator {
    width: 14px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.jersey-indicator.active {
    background-color: #fff;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Desktop hero + categories layout */
@media (min-width: 1041px) {
    .hero {
        width: 50%;
        float: left;
        margin-top: 72px;
        border-bottom: none;
        border-right: 1px solid var(--line);
        min-height: 80vh;
        display: flex;
        align-items: stretch;
    }

    .carousel {
        width: 100%;
        height: 100%;
        min-height: 80vh;
    }

    .categories-section {
        width: 50%;
        float: left;
        padding: 0;
        border-bottom: none;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 80vh;
        background: var(--surface);
    }

    .categories-section .container {
        width: 100%;
        padding: 3rem 2rem;
    }

    .categories-section .section-title {
        margin-bottom: 1.8rem;
        text-align: left;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .category-card:nth-child(even) {
        margin-top: 0;
    }

    .features-section {
        clear: both;
    }
}

/* Responsive */
@media (max-width: 1040px) {
    .jerseys-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jersey-card:nth-child(3n + 2) {
        margin-top: 0;
    }

    .jersey-card:nth-child(even) {
        margin-top: 22px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .hero {
        width: 100% !important;
        float: none !important;
        min-height: auto !important;
        border-bottom: 1px solid var(--line) !important;
        border-right: none !important;
    }

    .categories-section {
        width: 100% !important;
        float: none !important;
        min-height: auto !important;
        padding: 3.8rem 0 !important;
        display: block !important;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 72px;
        flex-direction: column;
        align-items: flex-start;
        background-color: #e9e9e4;
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        width: 100%;
        transition: left 0.3s ease;
        padding: 1.1rem 1.3rem;
        gap: 0.8rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .carousel {
        height: 55vh;
        min-height: 340px;
    }

    .carousel-caption {
        left: 16px;
        right: 16px;
        width: auto;
        bottom: 16px;
    }

    .categories-grid,
    .footer-content,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .category-card:nth-child(even),
    .jersey-card:nth-child(even) {
        margin-top: 0;
    }

    .social-links {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .container {
        padding: 0 16px;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .carousel {
        height: 48vh;
        min-height: 300px;
    }

    .carousel-btn {
        padding: 0.48rem 0.7rem;
        font-size: 0.92rem;
    }

    .carousel-caption h2 {
        font-size: 1.2rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }

    .section-ligas,
    .section-selecciones,
    .section-contacto,
    .categories-section,
    .features-section {
        padding: 2.5rem 0;
    }

    .section-title {
        margin-bottom: 1.5rem;
    }

    .filters {
        margin-bottom: 1.4rem;
    }

    .filter-btn {
        font-size: 0.78rem;
        padding: 0.56rem 0.74rem;
    }

    .jerseys-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .jersey-image {
        height: 250px;
    }

    .modal-body {
        padding: 0.9rem;
    }
}
