:root {
    --bg: #f6f6f4;
    --text: #1a1a1a;
    --muted: #666;
    --line: #ddd;
    --card: #fff;
    --brand: #111;
    --space-1: 0.4rem;
    --space-2: 0.75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        sans-serif;
    line-height: 1.5;
    font-size: clamp(15.5px, 0.38vw + 14px, 17px);
    overflow-x: hidden;
}

a {
    color: var(--text);
}

.container {
    max-width: none;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3.2vw, 3.2rem);
    &.no-padding {
        padding: 0;
    }
}

/* Masthead */
.masthead {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.05rem 3.2rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    justify-self: center;
    img {
        height: 72px;
    }
}

.menu-left {
    justify-self: start;
    display: flex;
    gap: 1.1rem;

    a {
        text-decoration: none;
        color: var(--text);
        font-weight: 500;
        text-transform: lowercase;
        font-size: clamp(0.98rem, 0.2vw + 0.9rem, 1.06rem);
        letter-spacing: 0.01em;

        &:hover {
            text-decoration: underline;
            text-underline-offset: 5px;
        }
    }
}

.menu-right {
    justify-self: end;
    display: flex;
    align-items: center;
}

.social {
    img {
        width: 20px;
        height: 20px;
        opacity: 0.85;

        &:hover {
            opacity: 1;
        }
    }
}

/* Hero Banner */
.hero-banner {
    position: relative;
    min-height: calc(100vh - 106px);
    width: 100%;
    max-width: 100vw;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    background-color: #fff;
    background-image: url("/imgs/landing.jpg");
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
    display: flex;
    align-items: stretch;
    padding: 0;
}

.hero-content {
    width: 42%;
    max-width: none;
    color: #fff;
    text-wrap: balance;
    padding: 2rem clamp(1rem, 3.2vw, 3.2rem);
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;

    h1 {
        font-size: clamp(2.5rem, 5.8vw, 4.4rem);
        line-height: 1.02;
        letter-spacing: -0.02em;
        margin: 0 0 0.65rem;
    }

    p {
        margin: 0;
        max-width: 44ch;
        font-size: clamp(1.22rem, 2.1vw, 1.7rem);
        line-height: 1.38;
    }
}

.hero-cta {
    margin-top: 1.2rem;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* Layout Components */
.band {
    width: 100%;
    max-width: 100vw;
    padding: 1.4rem 0;
    border-top: 1px solid var(--line);

    .intro {
        padding: 1rem 0;
    }

    &.band--light {
        background: #fff;
    }

    &.band--soft {
        background: #f1f1ee;
    }

    &.band--tienda {
        background: transparent;
        border-top: 0;
        padding: 1.15rem 0;
    }
}

.inner {
    max-width: none;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3.2vw, 3.2rem);
}

.block {
    margin-top: var(--space-4);

    h2 {
        margin: 0.1rem 0 0.9rem;
        font-size: clamp(1.35rem, 1vw + 1rem, 1.62rem);
        line-height: 1.18;
        letter-spacing: -0.01em;
    }
}

/* Tienda / Product List */
.tienda-page {
    background: var(--bg);
    padding-bottom: 2rem;
    padding-top: 1.5rem;
    padding-left: clamp(1rem, 3.2vw, 3.2rem);
    padding-right: clamp(1rem, 3.2vw, 3.2rem);
}

.tienda-title {
    font-size: clamp(2rem, 2.8vw, 2.6rem);
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin: 0.1rem 0 0.45rem;
}

.category-block {
    margin-top: 0.15rem;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);

    &:last-child {
        border-bottom: none;
    }
}

.category-title {
    margin: 0.2rem 0 1.05rem;
    font-size: clamp(1.32rem, 0.85vw + 1rem, 1.62rem);
    text-transform: capitalize;
    letter-spacing: -0.01em;
}

.intro p {
    max-width: 88ch;
    margin: 0.7rem auto;
    line-height: 1.64;
    font-size: 1.4rem;
    text-align: left;
    padding: 0 1.25rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;

    article {
        max-width: none;
        width: 100%;
        justify-self: stretch;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 1.25rem;
        display: flex;
        flex-direction: column;
    }

    img {
        width: 100%;
        max-height: 40vh;
        border-radius: 8px;
        aspect-ratio: 1/1;
        object-fit: contain;
        margin-bottom: 0.8rem;
    }

    h3 {
        margin: 0.2rem 0 0.5rem;
        font-size: 1.15rem;
    }

    p {
        margin: 0;
        color: #444;
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

.grid {
    display: grid;
    gap: 1rem;
}

.cards {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));

    &.cards--open {
        gap: 1.35rem;
    }
}

.card {
    display: block;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: inherit;
    text-decoration: none;
    transition:
        transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.2s ease;

    &:hover {
        transform: translateY(-3px);
        opacity: 0.96;

        img {
            transform: scale(1.015);
        }
    }

    img {
        width: 100%;
        aspect-ratio: 1/1;
        object-fit: cover;
        border-radius: 8px;
        transition: transform 0.32s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    h3 {
        margin: 0.55rem 0 0.2rem;
        font-size: 1.02rem;
        line-height: 1.25;
    }

    &.card-featured {
        padding: 0.55rem;
        border-radius: 12px;
        background: linear-gradient(180deg, #fff, #fcfcf8);
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);

        &:hover {
            transform: scale(1.02) translateY(-2px);
            box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
        }

        h3 {
            font-size: 1.1rem;
        }

        .price {
            font-size: 1.02rem;
        }
    }
}

.badge {
    display: inline-block;
    margin: 0.1rem 0 0.35rem;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.price {
    font-weight: 700;
    margin: 0;
    color: #111;
}

/* Product Detail Page */
.product-page {
    padding-top: 2rem;
}

.product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.media {
    max-width: 760px;
    img {
        width: 100%;
        border-radius: 12px;
        border: 1px solid var(--line);
        background: #fff;
    }
}

.details {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0.1rem 0;

    h1 {
        font-size: clamp(1.65rem, 2.5vw, 2.1rem);
        line-height: 1.12;
        margin: 0.1rem 0 0.55rem;
        letter-spacing: -0.01em;
    }

    h3 {
        font-size: 1.15rem;
        margin: 1.05rem 0 0.45rem;
    }

    p {
        font-size: 1rem;
        line-height: 1.62;
        margin: 0.55rem 0;
        color: #222;
    }

    li {
        margin: 0.28rem 0;
        line-height: 1.5;
    }
}

.secondary-description {
    margin: 0.2rem 0 0.25rem;
    p {
        margin: 0.55rem 0;
    }
}

.product-secondary {
    max-width: 1400px;
    margin: 1rem auto 0;
    padding: 1rem 0;
    border-top: 1px solid #d7d7d1;
}

.product-extra {
    max-width: 1400px;
    margin: 0.35rem auto 0;
    padding: 0.25rem 0;
}

.muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.variants {
    list-style: none;
    padding: 0;
    margin: 0.45rem 0 0;

    li {
        display: flex;
        justify-content: space-between;
        border-top: 1px solid #cfcfc8;
        padding: 0.62rem 0;
        font-size: 0.98rem;
    }
}

/* Product Actions & Buy Modal */
.product-actions {
    margin-top: 1.5rem;
}

.btn-buy {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    display: inline-block;
    width: auto;
}

.modal-buy {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-buy-content {
    background: #fff;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;

    h2 {
        margin-top: 0;
        font-size: 1.6rem;
    }
    h3 {
        margin: 1.5rem 0 0.5rem;
        font-size: 1.1rem;
        text-transform: uppercase;
        color: #666;
    }
    ul {
        padding-left: 1.2rem;
        margin: 0.5rem 0;
    }
    li {
        margin: 0.3rem 0;
    }
}

.modal-buy-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;

    &:hover {
        opacity: 1;
    }
}

.buy-methods {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.5rem 0;

    a {
        display: block;
        padding: 0.8rem;
        background: #f4f4f2;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        text-align: center;
        transition: background 0.2s;

        &:hover {
            background: #e8e8e4;
        }
    }
}

/* Contact Page */
.contact-page {
    padding: 3rem clamp(1rem, 3.2vw, 3.2rem);
    max-width: 1400px;
    margin: 0 auto;

    h1 {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
}

.intro-text {
    font-size: 1.25rem;
    color: var(--muted);
    margin-bottom: 3rem;
}

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

.contact-item {
    margin-bottom: 2rem;

    h3 {
        text-transform: uppercase;
        font-size: 0.9rem;
        letter-spacing: 0.05em;
        color: var(--muted);
        margin-bottom: 0.5rem;
    }

    p {
        font-size: 1.2rem;
        font-weight: 500;
        margin: 0;
    }

    a {
        text-decoration: none;
        &:hover {
            text-decoration: underline;
        }
    }
}

.contact-form-placeholder {
    background: #f8f8f6;
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;

    p {
        margin: 0;
        line-height: 1.6;
    }
}

/* Footer & Status */
.footer {
    background: #111;
    color: #fff;
    padding: 3rem 3.2rem;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;

    p {
        margin: 0;
    }

    .social img {
        filter: invert(1);
        width: 24px;
        height: 24px;
    }
}

.status-pill {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 0.6rem;
    border-radius: 999px;
    border: 1px solid #d2d2cc;
    font-size: 0.82rem;
    background: #fff;
    color: #222;

    &.status-ok {
        color: #065f46;
        border-color: #86efac;
        background: #ecfdf5;
    }

    &.status-bad {
        color: #991b1b;
        border-color: #fecaca;
        background: #fef2f2;
    }
}

/* Kit Page Specifics */
.kit-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.option {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;

    h2 {
        font-size: 1.3rem;
        margin: 0 0 1rem;
        line-height: 1.2;
    }

    .ribbon {
        position: absolute;
        top: 1rem;
        right: 1rem;
        display: inline-block;
        background: var(--brand);
        color: #fff;
        padding: 0.2rem 0.6rem;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 1rem;
        width: fit-content;
    }

    ul {
        margin: 1rem 0 0;
        padding-left: 1.2rem;
        font-size: 0.95rem;
    }

    li {
        margin: 0.4rem 0;
    }
}

.footnotes {
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    margin-top: 2rem;
}

/* Admin UI Components */
.admin-page {
    background: #f2f2ef;
    color: #111;
}

.admin-container {
    max-width: none;
    padding: 0;
}

.maintenance-strip {
    height: 10px;
    background: repeating-linear-gradient(
        135deg,
        #111 0 10px,
        #111 10px 20px,
        #facc15 20px 30px,
        #facc15 30px 40px
    );
}

.admin-head {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin: 0;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #d4d4d0;
    background: #f8f8f6;

    h1 {
        margin: 0;
    }
    p {
        margin: 0.15rem 0 0;
        color: #444;
    }
}

.admin-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-logo {
    height: 56px;
    display: block;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;

    input,
    button {
        background: #fff;
        color: #111;
        border: 1px solid #c8c8c2;
        border-radius: 8px;
        padding: 0.45rem 0.7rem;
    }

    input {
        min-width: 220px;
    }

    button {
        cursor: pointer;
        &.active {
            background: #111;
            color: #fff;
            border-color: #111;
        }
    }
}

.admin-bleed {
    width: 100%;
    padding: 0;
}

.admin-table-wrap {
    max-height: calc(100vh - 126px);
    overflow: auto;
    border: 1px solid #d6d6d1;
    background: #fff;
    border-radius: 10px;
}

.admin-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
    color: #111;

    th,
    td {
        border: 1px solid #ddd;
        padding: 0.35rem;
        vertical-align: top;
    }

    th {
        position: sticky;
        top: 0;
        background: #ecece8;
        z-index: 2;

        &:first-child {
            z-index: 4;
        }
    }

    td:first-child,
    th:first-child {
        position: sticky;
        left: 0;
        background: #f5f5f2;
        z-index: 3;
    }

    input,
    textarea,
    select {
        width: 100%;
        min-width: 0;
        max-width: none;
        background: #fff;
        color: #111;
        border: 1px solid #c9c9c3;
        border-radius: 6px;
        padding: 0.25rem;
        font: inherit;
        transition:
            border-color 0.15s ease,
            box-shadow 0.15s ease;

        &.dirty {
            border-color: #8b5cf6;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
        }
    }

    input {
        min-height: 28px;
        &[data-k="title"] {
            font-weight: 600;
        }
        &[data-k="title"],
        &[data-k="desc"] {
            width: 100%;
            min-width: 250px;
        }
    }

    textarea {
        min-height: 32px;
        resize: vertical;

        &.json {
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            &-invalid {
                border-color: #dc2626;
                box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
            }
        }
    }

    td:has(.CodeMirror) {
        min-width: 350px;
        padding: 0.5rem;
    }
}

.col-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 8;

    &::after {
        content: "";
        position: absolute;
        top: 18%;
        bottom: 18%;
        left: 3px;
        width: 1px;
        background: #c2c2bd;
    }
}

.CodeMirror {
    height: auto;
    min-height: 250px;
    border: 1px solid #c9c9c3;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    background: #fff;
    width: 100%;
    min-width: 320px;

    &-scroll {
        overflow-y: hidden;
        overflow-x: auto;
    }
}

/* RESPONSIVE OVERRIDES (900px breakpoint) */
@media (max-width: 900px) {
    .container {
        padding: 1.15rem 0 2rem;
    }

    .inner {
        padding: 0 1.25rem;
    }

    .masthead {
        display: flex;
        flex-direction: column;
        padding: 1.25rem;
        gap: 1.25rem;
        position: static;
    }

    .brand {
        order: 1;
        img {
            height: 62px;
        }
    }

    .menu-left {
        order: 2;
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .menu-right {
        display: flex;
        order: 3;
        justify-content: center;
        width: 100%;
        margin-top: 0.5rem;

        .social img {
            width: 24px;
            height: 24px;
        }
    }

    .hero-banner {
        min-height: 60vh;
        padding: 0;
        width: 100%;
        background-size: cover;
        background-position: center;
    }

    .hero-content {
        width: 100%;
        padding: 2rem 1.25rem;
        align-items: center;
        text-align: center;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .band {
        padding: 1.4rem 0;
    }

    .steps {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .product-page {
        padding-top: 1rem;
    }

    .product-main {
        grid-template-columns: 1fr;
        padding: 0 1.25rem;
        gap: 1.5rem;
    }

    .media {
        max-width: 100%;
    }

    .product-secondary {
        padding: 1rem 1.25rem;
    }

    .product-extra {
        padding: 0.25rem 0;
    }

    .modal-buy-content {
        padding: 2.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-page h1 {
        font-size: 2.5rem;
    }

    .footer {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 2rem 1rem;
    }

    .option .ribbon {
        position: static;
        margin-top: 0.5rem;
    }
}
