/* =============================== */
/*  VARIABLES Y CONFIGURACIÓN BASE */
/* =============================== */
@font-face {
    font-family: "Google Sans";
    src: url("../../fonts/GoogleSans_17pt-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Google Sans";
    src: url("../../fonts/GoogleSans_17pt-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Google Sans";
    src: url("../../fonts/GoogleSans_17pt-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Google Sans";
    src: url("../../fonts/GoogleSans_17pt-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Serif";
    src: url("../../fonts/InstrumentSerif-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Serif";
    src: url("../../fonts/InstrumentSerif-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --color-primary: #f0d28a;
    --color-primary-strong: #d6a64d;
    --color-text: #f7efe7;
    --color-text-dark: #2a1b16;
    --color-surface: rgba(243, 233, 223, 0.9);
    --color-surface-strong: #121212;
    --color-background: #1b100d;
    --color-border-soft: rgba(247, 239, 231, 0.22);
    --color-overlay: rgba(32, 14, 8, 0.42);
    --font-family-base: "Google Sans", sans-serif;
    --font-family-display: "Instrument Serif", serif;
    --max-width-container: 1680px;
    --spacing-unit: 1rem;
    --header-offset: 1.6rem;
    --header-height: 4.5rem;
    --shadow-soft: 0 18px 60px rgba(14, 8, 5, 0.22);
}

/* =============================== */
/*  RESETEO Y TIPOGRAFÍA GENERAL   */
/* =============================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    color: var(--color-text);
    /* background-color: var(--color-background); */
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

.site-toast-stack {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(20, 10, 5, 0.52);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.site-toast-stack.is-active {
    display: flex;
}

.site-toast {
    position: relative;
    width: min(100%, 25rem);
    padding: 2rem 2rem 1.65rem;
    border: 1px solid rgba(197, 188, 174, 0.46);
    border-radius: 1.4rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7f3ed 100%);
    box-shadow: 0 28px 60px rgba(30, 14, 8, 0.2);
    transform: translateY(0.55rem) scale(0.97);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.site-toast.is-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.site-toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.28rem;
    border-radius: 1.4rem 0 0 1.4rem;
    background: #bc8d2b;
}

.site-toast[data-state="success"]::before {
    background: #738247;
}

.site-toast[data-state="error"]::before {
    background: #a55245;
}

.site-toast[data-state="warning"]::before {
    background: #b0811a;
}

.site-toast__body {
    display: grid;
    gap: 0.35rem;
    padding-left: 0.5rem;
}

.site-toast__title {
    margin: 0 0 0.1rem;
    color: #1a110c;
    font-family: var(--font-family-display);
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1;
}

.site-toast__message {
    margin: 0;
    color: #7a746d;
    font-family: var(--font-family-base);
    font-size: 0.95rem;
    line-height: 1.48;
}

.site-toast__close {
    display: block;
    width: 100%;
    min-height: 2.85rem;
    margin-top: 1.5rem;
    padding: 0 1.1rem;
    border: 1px solid rgba(161, 152, 140, 0.4);
    border-radius: 0.5rem;
    background: transparent;
    color: #7a746d;
    font-family: var(--font-family-base);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.site-toast__close:hover,
.site-toast__close:focus-visible {
    background: #f0ece5;
    color: #2a1b16;
    outline: none;
}

/* ─── Skeleton / shimmer ─── */

@keyframes skeleton-shimmer {
    from { background-position: -200% 0; }
    to   { background-position:  200% 0; }
}

/* Texto de precio en el sidebar del producto (fondo blanco) */
[data-product-detail][data-loading] [data-product-total],
[data-product-detail][data-loading] [data-product-unit-price] {
    display: inline-block;
    min-width: 5rem;
    border-radius: 0.3em;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.07) 25%,
        rgba(0, 0, 0, 0.14) 50%,
        rgba(0, 0, 0, 0.07) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

/* Presentaciones y botón agregar bloqueados mientras carga */
[data-product-detail][data-loading] [data-product-presentations] {
    opacity: 0.35;
    pointer-events: none;
}

[data-product-detail][data-loading] [data-product-add] {
    opacity: 0.4;
    pointer-events: none;
}

::selection {
    background-color: rgba(240, 210, 138, 0.28);
    color: #ffffff;
}

@media (max-width: 720px) {
    html {
        font-size: 14px;
    }

}

/* ─── Product card — base visual compartido ─── */

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: #d7d1c8;
    color: #ffffff;
    transition: color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover,
.product-card:focus-within {
    color: #2b1914;
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(63, 42, 28, 0.1);
}

.product-card__weight {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background-color: #f7d66f;
    color: #a87717;
    font-family: var(--font-family-base);
    font-weight: 500;
    text-transform: uppercase;
}

.product-card__name {
    position: relative;
    z-index: 3;
    max-width: 6ch;
    margin: 0;
    font-family: var(--font-family-display);
    font-weight: 400;
    line-height: 0.92;
    text-transform: uppercase;
}

.product-card__visual {
    position: absolute;
    inset: 0;
}

.product-card__packshot {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}

.product-card__packshot-default,
.product-card__packshot-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity 0.3s ease;
}

.product-card__packshot-default {
    object-fit: cover;
    object-position: center;
    opacity: 1;
}

.product-card__packshot-hover {
    object-fit: cover;
    object-position: center;
    opacity: 0;
}

.product-card:hover .product-card__packshot-default,
.product-card:focus-within .product-card__packshot-default {
    opacity: 0;
}

.product-card:hover .product-card__packshot-hover,
.product-card:focus-within .product-card__packshot-hover {
    opacity: 1;
}

.product-card__footer {
    position: relative;
    z-index: 3;
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.product-card__price {
    margin: 0;
    font-family: var(--font-family-display);
    line-height: 0.9;
    font-weight: 400;
}

.product-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0 0.95rem;
    border-radius: 0.35rem;
    background-color: #111111;
    color: #f5cf61;
    font-family: var(--font-family-display);
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.5rem);
    transition: opacity 0.3s ease, transform 0.3s ease;
    letter-spacing: 0.03em;
}

.product-card__button::after {
    content: none;
}

.product-card:hover .product-card__button,
.product-card:focus-within .product-card__button {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
