/*
Theme Name: EDMIA Child
Template: generatepress
Version: 1.0
Description: Child theme oficial de EDMIA.shop — Sprint 2 Header
*/

/* ─────────────────────────────────────────────
   TOKENS GLOBALES
───────────────────────────────────────────── */
:root {
  --edmia-black:        #111111;
  --edmia-bg:           #fdf8f8;
  --edmia-text:         #222222;
  --edmia-accent:       #bb0013;
  --edmia-accent-hover: #8e000e;
  --edmia-font:         'Inter', sans-serif;
  --edmia-radius:       8px;
  --edmia-radius-lg:    999px;
  --edmia-border:       #c4c7c7;
  --edmia-surface:      #f1edec;
  --edmia-surface-hover:#e5e2e1;
  --edmia-text-muted:   #747878;
  --edmia-overlay:      rgba(0, 0, 0, 0.45);
  --drawer-width:       300px;
  --header-height:      64px;
  --transition:         300ms ease;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--edmia-font);
  background-color: var(--edmia-bg);
  color: var(--edmia-text);
  -webkit-font-smoothing: antialiased;
}

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

/* ─────────────────────────────────────────────
   === HEADER ===
───────────────────────────────────────────── */

.edmia-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: var(--header-height);
  background-color: var(--edmia-bg);
  border-bottom: 1px solid var(--edmia-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-leading  { flex: 1; display: flex; justify-content: flex-start; }
.header-center   { flex: 0 0 auto; }
.header-trailing {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.edmia-logo {
  font-family: var(--edmia-font);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--edmia-black);
  text-transform: uppercase;
  text-decoration: none;
}

.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--edmia-black);
  padding: 8px;
  transition: opacity var(--transition);
  text-decoration: none;
}
.icon-btn:hover { opacity: 0.7; }

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background-color: var(--edmia-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 640px) {
  .hide-on-mobile { display: none !important; }
  .edmia-logo     { font-size: 24px; }
}

/* ─────────────────────────────────────────────
   === DRAWER & OVERLAY ===
───────────────────────────────────────────── */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background-color: var(--edmia-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--drawer-width);
  max-width: 85vw;
  z-index: 100;
  background-color: var(--edmia-bg);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition);
}
.drawer.is-open { transform: translateX(0); }

.drawer-header {
  height: var(--header-height);
  background-color: var(--edmia-black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.drawer-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
}

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: opacity var(--transition);
}
.drawer-close:hover { opacity: 0.7; }

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 32px 0;
}

.drawer-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--edmia-black);
  text-decoration: none;
  transition: background-color var(--transition);
}
.drawer-nav a:hover { background-color: var(--edmia-surface-hover); }

.drawer-nav .nav-accent {
  color: var(--edmia-accent);
  font-weight: 700;
}

.drawer-divider {
  height: 1px;
  background-color: var(--edmia-border);
  margin: 16px 24px;
  opacity: 0.5;
  list-style: none;
}

/* Scrollbar custom */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: var(--edmia-bg); }
::-webkit-scrollbar-thumb { background: var(--edmia-black); }

/* ─────────────────────────────────────────────
   Compatibilidad con GeneratePress (reset cabecera nativa)
───────────────────────────────────────────── */

/* Ocultar header de GeneratePress para que no compita con el nuestro */
.site-header {
  display: none !important;
}
