﻿:root {
    --cs-terracotta: #d3ab9e;
    --cs-blush: #eac9c1;
    --cs-sand: #ebd8d0;
    --cs-ivory: #fffbff;
    --cs-mist: #fefeff;
    --cs-ink: #393436;
    --cs-muted: #7d7472;
    --cs-line: #ebdfdb;
    --cs-sage: #b8c9bf;
    --cs-sage-dark: #587064;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--cs-ivory);
    color: var(--cs-ink);
    font-family: 'DM Sans', Arial, sans-serif;
}

a {
    color: inherit;
}

/* Encabezado publico */
.store-topbar {
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0 16px;
    background: var(--cs-sand);
    color: #665a57;
    font-size: 11px;
    text-align: center;
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 66px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 5vw;
    border-bottom: 1px solid var(--cs-line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
}

/* El layout publico no utiliza menu hamburguesa. */
.store-menu-button {
    display: none !important;
}

.store-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.store-brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--cs-terracotta), var(--cs-blush));
    color: #fff;
    font-weight: 800;
}

.store-brand-copy {
    min-width: 0;
}

    .store-brand-copy strong {
        display: block;
        overflow: hidden;
        font: 700 18px 'Manrope', sans-serif;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .store-brand-copy small {
        display: block;
        color: var(--cs-muted);
        font-size: 9px;
        letter-spacing: 0.07em;
    }

.store-nav {
    min-width: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 7px;
}

    /* Sólo enlaces directos de la barra. No afecta enlaces dentro del menú de cuenta. */
    .store-nav > a {
        padding: 9px 13px;
        border-radius: 10px;
        color: inherit;
        font-size: 14px;
        text-decoration: none;
    }

        .store-nav > a:hover {
            background: #f8eeeb;
            color: #926d64;
        }

.store-cart-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    background: var(--cs-ink) !important;
    color: #fff !important;
    white-space: nowrap;
}

/* Inicio de sesión */
.store-login-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 7px 11px !important;
    border: 1px solid var(--cs-line);
    border-radius: 12px !important;
    background: #fff;
    color: var(--cs-ink);
    font-weight: 700;
    white-space: nowrap;
}

    .store-login-link:hover {
        background: #f8eeeb !important;
        color: #926d64 !important;
    }

.store-login-icon {
    display: none;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #f3e4df;
    color: #966b62;
    font-size: 12px;
    font-weight: 800;
}

.store-login-text {
    display: inline;
}

/* Cuenta conectada */
.store-account-menu {
    position: relative;
    flex: 0 0 auto;
}

    .store-account-menu[open] {
        z-index: 90;
    }

    .store-account-menu > summary {
        min-height: 42px;
        max-width: 245px;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 5px 8px;
        border: 1px solid var(--cs-line);
        border-radius: 12px;
        background: #fff;
        cursor: pointer;
        list-style: none;
    }

        .store-account-menu > summary::marker,
        .store-account-menu > summary::-webkit-details-marker {
            display: none;
            content: '';
        }

.store-account-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f3e4df;
    color: #966b62;
    font-size: 13px;
    font-weight: 800;
}

.store-account-copy {
    min-width: 0;
    display: block;
    text-align: left;
}

    .store-account-copy small,
    .store-account-copy strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .store-account-copy small {
        color: var(--cs-muted);
        font-size: 8px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .store-account-copy strong {
        max-width: 155px;
        color: var(--cs-ink);
        font-size: 11px;
    }

.store-account-caret {
    flex: 0 0 auto;
    color: #9a8c89;
    font-size: 13px;
}

.store-account-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 100;
    width: 270px;
    padding: 9px;
    overflow: hidden;
    border: 1px solid var(--cs-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(57, 52, 54, 0.15);
}

.store-account-current {
    display: grid;
    gap: 3px;
    padding: 10px 11px 9px;
    border-bottom: 1px solid var(--cs-line);
}

    .store-account-current small,
    .store-account-current strong {
        display: block;
    }

    .store-account-current small {
        color: #a17167;
        font-size: 8px;
        font-weight: 800;
        letter-spacing: 0.09em;
    }

    .store-account-current strong {
        overflow: hidden;
        color: var(--cs-ink);
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.store-account-panel > a,
.store-account-panel form button {
    position: static;
    width: 100%;
    min-height: 42px;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--cs-ink);
    font: 600 12px 'DM Sans', sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transform: none !important;
}

    .store-account-panel > a:hover,
    .store-account-panel > a:focus-visible,
    .store-account-panel form button:hover,
    .store-account-panel form button:focus-visible {
        background: #f8eeeb;
        color: #926d64;
    }

.store-account-panel form {
    width: 100%;
    display: block !important;
    margin: 3px 0 0;
    padding-top: 4px;
    border-top: 1px solid var(--cs-line);
}

    .store-account-panel form button {
        color: #98584f;
    }

/* Pie */
.store-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 18px;
    border-top: 1px solid var(--cs-line);
    background: #f7efec;
    color: var(--cs-muted);
}

    .store-footer strong {
        color: var(--cs-ink);
        font: 700 20px 'Manrope', sans-serif;
    }

    .store-footer small {
        margin-top: 4px;
    }

/* Páginas de estado 403, 404 y 500 */
.system-page-shell {
    min-height: calc(100vh - 235px);
    display: grid;
    place-items: center;
    padding: 52px 20px;
}

.system-page-card {
    width: 100%;
    max-width: 940px;
    height: 360px;
    min-height: 360px;
    max-height: 360px;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--cs-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(57, 52, 54, 0.08);
}

.system-page-visual {
    position: relative;
    height: 360px;
    min-height: 360px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #3e3839, #655455);
    color: #fff;
}

.system-page-card-error .system-page-visual {
    background: linear-gradient(145deg, #6f4c47, #a16f65);
}

.system-page-symbol {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 42px;
    font-weight: 700;
}

.system-page-code {
    position: absolute;
    bottom: 22px;
    left: 26px;
    color: rgba(255, 255, 255, 0.2);
    font: 800 58px 'Manrope', sans-serif;
    letter-spacing: 3px;
}

.system-page-content {
    min-width: 0;
    height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
}

.system-page-eyebrow {
    margin: 0 0 8px !important;
    color: #a17167 !important;
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.system-page-content h1 {
    min-height: 76px;
    max-width: 560px;
    display: flex;
    align-items: flex-end;
    margin: 0;
    color: var(--cs-ink);
    font: 700 32px/1.18 'Manrope', sans-serif;
}

.system-page-content > p:not(.system-page-eyebrow) {
    min-height: 47px;
    max-width: 580px;
    margin: 15px 0 0;
    color: var(--cs-muted);
    font-size: 14px;
    line-height: 1.65;
}

.system-page-actions {
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 27px;
}

.system-page-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.system-page-button-primary {
    border-color: var(--cs-ink);
    background: var(--cs-ink);
    color: #fff;
}

.system-page-button-secondary {
    border-color: #d9bbb3;
    background: #fff;
    color: #865f57;
}

.system-page-text-link {
    display: inline-flex;
    margin-top: 18px;
    color: #8f6259;
    font-size: 11px;
    font-weight: 700;
}

.system-page-reference {
    min-height: 58px;
    margin-top: 24px;
    padding: 12px 14px;
    border-radius: 11px;
    background: #f8f3f1;
}

    .system-page-reference small,
    .system-page-reference code {
        display: block;
    }

    .system-page-reference small {
        color: #9a7770;
        font-size: 8px;
        font-weight: 800;
        letter-spacing: 0.08em;
    }

    .system-page-reference code {
        margin-top: 4px;
        overflow-wrap: anywhere;
        color: #62585a;
        font-size: 10px;
    }

.system-page-help {
    min-height: 16px;
    display: block;
    margin-top: 18px;
    color: #968b8d;
    font-size: 10px;
}

/* Perfil de cuenta administrativa */
.admin-account-shell {
    min-height: calc(100vh - 235px);
    display: grid;
    place-items: center;
    padding: 48px 20px;
}

.admin-account-card {
    width: 100%;
    max-width: 820px;
    padding: 34px;
    border: 1px solid var(--cs-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 52px rgba(57, 52, 54, 0.08);
}

    .admin-account-card header {
        display: flex;
        align-items: center;
        gap: 16px;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--cs-line);
    }

.admin-account-avatar {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    background: #f2e2dd;
    color: #986a61;
    font-size: 24px;
    font-weight: 800;
}

.admin-account-card header p {
    margin: 0 0 4px;
    color: #a17167;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.admin-account-card header h1 {
    margin: 0;
    color: var(--cs-ink);
    font: 700 28px 'Manrope', sans-serif;
}

.admin-account-card header div > span {
    color: var(--cs-muted);
    font-size: 12px;
}

.admin-account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid var(--cs-line);
    border-radius: 14px;
}

    .admin-account-grid > div {
        display: grid;
        gap: 5px;
        padding: 18px;
    }

        .admin-account-grid > div:nth-child(odd) {
            border-right: 1px solid var(--cs-line);
        }

        .admin-account-grid > div:nth-child(-n + 2) {
            border-bottom: 1px solid var(--cs-line);
        }

    .admin-account-grid small {
        color: #9a7770;
        font-size: 8px;
        font-weight: 800;
        letter-spacing: 0.08em;
    }

    .admin-account-grid strong {
        color: var(--cs-ink);
        font-size: 12px;
    }

.admin-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
}

.admin-account-note {
    margin: 18px 0 0;
    color: #8b8082;
    font-size: 10px;
    line-height: 1.55;
}

/* Tablet: el correo se oculta sólo en el botón, no dentro del panel. */
@media (max-width: 900px) {
    .store-nav-wide {
        display: none !important;
    }

    .store-account-menu > summary .store-account-copy {
        display: none;
    }

    .store-account-menu > summary {
        padding: 5px;
    }

        .store-account-menu > summary .store-account-caret {
            display: none;
        }
}

/* Móvil */
@media (max-width: 700px) {
    .store-nav {
        gap: 4px;
    }

        .store-nav > .store-nav-catalog {
            display: none !important;
        }

    .store-account-panel {
        position: fixed;
        top: 102px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .system-page-card,
    .system-page-visual,
    .system-page-content {
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .system-page-card {
        grid-template-columns: 1fr;
    }

    .system-page-visual {
        min-height: 165px;
    }

    .system-page-symbol {
        width: 70px;
        height: 70px;
        border-radius: 21px;
        font-size: 31px;
    }

    .system-page-code {
        font-size: 40px;
    }

    .system-page-content {
        padding: 30px 23px;
    }

        .system-page-content h1 {
            min-height: 0;
            font-size: 25px;
        }

        .system-page-content > p:not(.system-page-eyebrow),
        .system-page-actions,
        .system-page-reference {
            min-height: 0;
        }

    .system-page-actions {
        flex-direction: column;
    }

    .system-page-button {
        width: 100%;
    }
}

/* Cuenta y cabecera móvil. Los selectores sólo afectan hijos directos de la barra. */
@media (max-width: 620px) {
    .store-topbar {
        font-size: 10px;
    }

    .store-header {
        height: 66px;
        gap: 8px;
        padding: 0 12px;
    }

    .store-brand {
        gap: 8px;
    }

    .store-brand-mark {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .store-brand-copy small {
        display: none;
    }

    .store-brand-copy strong {
        font-size: 17px;
    }

    .store-nav {
        gap: 6px;
    }

        .store-nav > a:not(.store-cart-link):not(.store-login-link) {
            display: none;
        }

    .store-login-link {
        min-width: 42px;
        height: 42px;
        padding: 6px !important;
    }

    .store-login-icon {
        display: grid;
    }

    .store-login-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .store-account-menu > summary {
        min-width: 42px;
        min-height: 42px;
        justify-content: center;
        padding: 5px !important;
    }

    .store-account-avatar {
        width: 30px;
        height: 30px;
    }

    /* El panel mantiene siempre todos sus enlaces. */
    .store-account-panel > a,
    .store-account-panel form,
    .store-account-panel form button,
    .store-account-current,
    .store-account-current small,
    .store-account-current strong {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .store-account-current {
        display: grid !important;
    }

    .store-account-panel form {
        display: block !important;
    }

    .store-cart-link {
        min-height: 42px;
        padding: 9px 10px !important;
    }
}

/* Perfil administrativo móvil */
@media (max-width: 650px) {
    .admin-account-card {
        padding: 24px 18px;
    }

    .admin-account-grid {
        grid-template-columns: 1fr;
    }

        .admin-account-grid > div {
            border-right: 0 !important;
            border-bottom: 1px solid var(--cs-line) !important;
        }

            .admin-account-grid > div:last-child {
                border-bottom: 0 !important;
            }

    .admin-account-actions {
        flex-direction: column;
    }

        .admin-account-actions a {
            width: 100%;
        }
}

/* Sólo teléfonos extremadamente estrechos: encabezado compacto. */
@media (max-width: 390px) {
    .store-header {
        gap: 6px;
        padding: 0 9px;
    }

    .store-brand-copy strong {
        font-size: 15px;
    }

    .store-brand-mark {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        border-radius: 10px;
    }

    .store-nav {
        gap: 4px;
    }

    .store-login-link,
    .store-account-menu > summary {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .store-cart-link {
        min-height: 38px;
        padding: 8px !important;
        font-size: 12px !important;
    }

    .store-account-panel {
        top: 100px;
        right: 8px;
        left: 8px;
    }
}
