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

header {
  background-image: url("../images/elegant_marble_background_with_gold_glitter_2605.jpg");
  background-color: #F7F3F0;
  background-position: center 60%;
  padding: 30px 2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5; /* por si algo lo tapa */
}

.logo-center img {
  height:95px;
  width: auto;
}

/* WRAPPER */
.cart-wrapper-header {
    position: relative;
    display: inline-block;
}

/* BOTÓN */
.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: transform .15s ease;
}

/* ANIMACIÓN HOVER */
.cart-btn:hover {
    transform: scale(1.08);
}


/* BURBUJA DEL CONTADOR */
.cart-count-header {
    position: absolute;
    top: 12px;
    right: -10px;

    background: #d4af37;
    color: white;
    font-size: 11px;
    font-weight: 700;

    padding: 2px 6px;
    border-radius: 999px;   /* bubble */

    min-width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;

    pointer-events: none;
}



/* ==== SEARCH ==== */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  transition: all 0.4s ease;
  overflow: hidden;
}

.search-icon {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon svg {
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: transform 0.3s ease, fill 0.3s ease;
  fill: #333;
}

.search-icon svg:hover {
  transform: scale(1.2);
  fill: #d4af37;
}

.search-input {
  width: 0;
  opacity: 0;
  padding: 6px 10px;
  margin-left: 10px;
  border: 1px solid #d4af37;
  border-radius: 18px;
  outline: none;
  transition: width 0.4s ease, opacity 0.4s ease;
  font-size: 1rem;
}

.search-container.active .search-input {
  width: 180px;
  opacity: 1;
}

/* ==== NAV ==== */
nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav ul {
  display: flex;
  gap: 15%;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

nav li {
  margin: 0;
}

.arrow-down {
  width: 18px;
  height: 18px;
  margin-left: 4px;
  position: relative;
  top: 1px;
  transition: transform 0.2s ease;
}

nav a:hover .arrow-down {
  transform: translateY(2px);
}

nav a {
  font-size: 0.9rem;
  position: relative;
  display: inline-flex;
  justify-content: center;
  padding: 6px 0;
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 3px;
  background-color: #d4af37;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
  border-radius: 1px;
}

nav a:hover::after,
nav a:focus::after {
  transform: scaleX(1);
}

nav a:hover {
  color: #d4af37;
}


/* ===== CATALOG DROPDOWN ===== */

.catalog-dropdown {
  position: static;
}

/* rectángulo horizontal */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 85%;
  background: #fff;
  padding: 25px 30px;
  display: none;
  box-shadow: 0 8px 22px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}

/* animación */
.catalog-dropdown:hover .mega-menu {
  display: block;
  opacity: 1;
}

/* grid de columnas */
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

/* cada columna */
.mega-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* links */
.mega-menu a {
  color: #333;
  font-size: 0.9rem;
  padding: 6px 0;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

/* hover */
.mega-menu a:hover {
  background: #f3e7d1;
  color: #b9972e;
}

.catalog-dropdown.active-catalog > a {
  color: #d4af37;
}

.catalog-dropdown.active-catalog > a::after {
  transform: scaleX(1);
}


/* ==== ACTIONS ==== */
.header-actions {
  display: flex;
  align-items: right;
  gap: 18px;
}

.header-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}

.header-actions svg {
  stroke: #000;
  transition: stroke 0.3s ease, transform 0.3s ease;
}

.header-actions a:hover svg {
  stroke: #d4af37;
  transform: scale(1.1);
}

/* ==== SUB-HEADER ==== */
.sub-header {
  background: linear-gradient(90deg, #b9972e 0%, #f9e076 25%, #d4af37 50%, #f9e076 75%, #b9972e 100%);
  color: white;
  text-align: center;
  padding: 6px 0;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}
.sub-header p {
  margin: 0;
}


.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  font-size: 13px;
  font-weight: 600;
}

.lang-switcher a {
  color: #333;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.lang-switcher a.active,
.lang-switcher a:hover {
  opacity: 1;
}

.lang-switcher span {
  opacity: 0.4;
}


/* ==== HAMBURGER MENU ==== */
.menu-toggle {
  display: none;
  cursor: pointer;
  color: #000;
}



/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
    header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        padding: 18px 16px;
    }
    
    .search-input {
        width: 100% !important;
        opacity: 1 !important;
        margin-left: 0;
      }
      

    
    .menu-toggle {
      position: relative;   /* CONTENEDOR DE LOS SVG */
      width: 28px;
      height: 28px;
      display: flex;
    z-index: 10;
      align-items: center;
      justify-content: center;
    }
    
    .menu-toggle svg {
      position: absolute;
      transition: opacity 0.25s ease, transform 0.25s ease;
    }
    
    .icon-close {
      opacity: 0;
      transform: rotate(-90deg) scale(0.8);
    }
    
    /* cuando el menú está activo */
    .menu-toggle.active .icon-hamburger {
      opacity: 0;
      transform: rotate(90deg) scale(0.8);
    }
    
    .menu-toggle.active .icon-close {
      opacity: 1;
      transform: rotate(0) scale(1);
    }

    .logo-center img {
        height: 70px;
    }
    
    .header-actions {
        gap: 8px;
    }

    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        padding: 20px 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    nav.active {
        display: flex;
    }

    nav ul {
        align-items: center;
        flex-direction: column;
        gap: 15px;
    }


.catalog-dropdown {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.catalog-dropdown {
  position: static;
  width: 100%;
}

    .mega-col {
      align-items: center;
      text-align: center;
    }

/* grid → lista */
.mega-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mega-menu a {
  display: block;
  width: fit-content;
  padding: 6px 0;
  font-size: 0.9rem;
  text-align: center;
  color: #777;
}
    

    .search-container {
        justify-content: center;
        margin-bottom: 10px;
    }
}