/* ============================================================
   cabecera.css  –  Tienda de Peluches
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

:root {
    --header-bg:        #4a3828;
    --header-text:      #f5f0e8;
    --header-accent:    #b07d4f;
    --header-muted:     #c4aa92;
    --header-border:    rgba(245,240,232,0.15);
    --header-menu-bg:   #3d3028;
    --transition:       0.25s cubic-bezier(.4,0,.2,1);
}

/* ── Cabecera ───────────────────────────────────────────────── */
header {
    background: var(--header-bg);
    border-bottom: 2px solid var(--header-accent);
    padding: 16px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 4px 24px rgba(0,0,0,0.20);
}

/* ── Título ─────────────────────────────────────────────────── */
.header-titulo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-titulo a {
    text-decoration: none;
    color: var(--header-text);
    transition: color var(--transition);
}

.header-titulo a:hover {
    color: var(--header-accent);
}

.header-titulo h1 {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--header-text);
    line-height: 1.2;
}

.header-titulo h3 {
    margin: 0;
    font-family: 'Lato', sans-serif;
    font-size: 0.72rem;
    font-weight: 300;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--header-muted);
}

/* ── Nav ────────────────────────────────────────────────────── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-nav a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--header-text);
    transition: color var(--transition);
}

.header-nav a:hover {
    color: var(--header-accent);
}

/* ── Carrito ────────────────────────────────────────────────── */
.carrito-icon {
    font-size: 1.5em;
    position: relative;
    display: inline-block;
    line-height: 1;
}

.carrito-badge {
    position: absolute;
    top: -7px;
    right: -11px;
    background: var(--header-accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.42em;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
}

/* ── Usuario ────────────────────────────────────────────────── */
.usuario-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--header-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    flex-shrink: 0;
    color: var(--header-text);
    transition: background var(--transition);
}

.usuario-wrapper:hover .usuario-icon {
    background: var(--header-accent);
}

.usuario-texto {
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--header-text);
}

/* ── Dropdown ───────────────────────────────────────────────── */
.usuario-wrapper {
    position: relative;
}

.usuario-wrapper:hover .usuario-menu,
.usuario-wrapper:focus-within .usuario-menu {
    display: block;
    animation: fadeDown 0.18s ease;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.usuario-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 190px;
    background: var(--header-menu-bg);
    border: 1px solid var(--header-border);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
    z-index: 300;
    padding: 6px 0;
    overflow: hidden;
}

.usuario-menu a {
    display: block;
    padding: 11px 18px;
    color: var(--header-text);
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.usuario-menu a:hover {
    background: rgba(176,125,79,0.18);
    color: var(--header-accent);
}

.usuario-menu hr {
    border: none;
    border-top: 1px solid var(--header-border);
    margin: 4px 0;
}

/* ── Footer complementario ──────────────────────────────────── */
footer {
    background-color: #000;
    color: rgba(245, 240, 232, 0.55);
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    border-top: 2px solid #2c2218;
    padding: 18px 48px;
    text-align: center;
}

footer a {
    color: rgba(176, 125, 79, 0.75);
    transition: color 0.2s;
}
footer a:hover { color: #b07d4f; }

footer img {
    filter: invert(1) opacity(0.4);
    vertical-align: middle;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
    header { padding: 14px 20px; }
    .header-titulo h1 { font-size: 1.2rem; }
    .header-titulo h3 { display: none; }
    .usuario-texto    { display: none; }
    .header-nav       { gap: 16px; }
}