/* ==========================================
   MIFLY — Apple Style CSS
   Strict minimalist structure
   ========================================== */

/* ---------- Core Variables ---------- */
:root {
  --brand-orange: #FF6600;
  --brand-orange-hover: #E55B00;
  
  --bg-color: #000000;
  --text-color: #f5f5f7;
  
  --nav-bg: rgba(0, 0, 0, 0.8);
  --nav-text: #e8e8ed;

  --footer-bg: #111111;
  --footer-text: #888888;
  --footer-border: #333333;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg-color: #fbfbfd;
  --text-color: #1d1d1f;
  
  --nav-bg: rgba(255, 255, 255, 0.8);
  --nav-text: #1d1d1f;
  
  --footer-bg: #f5f5f7;
  --footer-text: #6e6e73;
  --footer-border: #d2d2d7;
}

/* ---------- Resets ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ---------- Global Nav ---------- */
.globalnav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 44px;
  background-color: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 9999;
  font-size: 12px;
}

.globalnav-content {
  max-width: 1000px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  height: 32px; /* Agrandado según la petición */
  width: auto;
  border-radius: 2px;
  display: block;
  transition: opacity 0.2s;
}

.logo:hover img {
  opacity: 0.8;
}

.globalnav-list {
  display: flex;
  gap: 32px;
}

.globalnav-list a {
  color: var(--nav-text);
  font-weight: 400;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.globalnav-list a:hover {
  opacity: 1;
}

.globalnav-actions {
  color: var(--nav-text);
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* ---------- Modules (Apple Sections) ---------- */
.module {
  position: relative;
  width: 100%;
  height: 650px;
  margin-top: 12px; /* Apple has small gaps between sections sometimes, or 0. We'll use 0 for hero */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.module-hero:first-of-type {
  margin-top: 44px; /* Offset for fixed nav */
  height: calc(100vh - 44px);
  min-height: 600px;
  max-height: 800px;
}

.module-hero {
  margin-top: 12px;
  height: 650px;
}

/* Dark vs Light Modules removed - now handled by global theme */
.module-dark, .module-light {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* Typography inside Modules */
.module-content {
  z-index: 2;
  margin-top: 55px; /* Spacing from top */
  padding: 0 20px;
  width: 100%;
}

.category {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--brand-orange);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.headline {
  font-size: 56px;
  font-weight: 600;
  line-height: 1.07143;
  letter-spacing: -0.005em;
  margin-bottom: 6px;
}

.subhead {
  font-size: 28px;
  font-weight: 400;
  line-height: 1.10722;
  letter-spacing: 0.004em;
  margin-bottom: 14px;
}

/* CTA Links (Buttons & Text links) */
.cta-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 15px;
}

.btn {
  font-size: 17px;
  line-height: 1.17648;
  font-weight: 400;
  letter-spacing: -0.022em;
}

.btn-primary {
  background-color: var(--brand-orange);
  color: #fff;
  padding: 11px 21px;
  border-radius: 980px; /* Pill shape */
  font-weight: 400;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--brand-orange-hover);
}

.btn-link {
  color: var(--brand-orange);
}

.btn-link:hover {
  text-decoration: underline;
}

.arrow {
  font-size: 13px;
  margin-left: 2px;
}

/* Images */
.module-image {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  height: calc(100% - 200px); /* Fill space below text */
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1;
}

.module-image img {
  width: auto;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom;
}

/* Exceptions for images that need to be smaller */
.module-hero.module-light .module-image img {
  height: 80%; /* Earbuds scale down a bit */
  margin-bottom: 20px;
}


/* ---------- Grid System (50/50 Layout) ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px;
}

.module-tile {
  position: relative;
  height: 580px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.module-tile .headline {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: 0em;
}

.module-tile .subhead {
  font-size: 21px;
  line-height: 1.19048;
  letter-spacing: 0.011em;
}

.module-tile .module-image {
  height: calc(100% - 170px);
}

.module-tile .module-image img {
  height: 90%;
  margin-bottom: 20px;
}

/* Centered tile (no big image at bottom, just centered content) */
.tile-centered {
  justify-content: center;
}
.tile-centered .module-content {
  margin-top: 0;
}


/* ---------- Footer ---------- */
.global-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  font-size: 12px;
  line-height: 1.33337;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding: 17px 22px 21px;
  transition: background-color 0.3s, color 0.3s;
}

.footer-content {
  max-width: 980px;
  margin: 0 auto;
}

.footer-notes {
  border-bottom: 1px solid var(--footer-border);
  padding-bottom: 17px;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}

.footer-directory {
  display: flex;
  flex-wrap: wrap;
  padding-bottom: 20px;
}

.footer-column {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
}

.footer-column h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 9px;
  transition: color 0.3s;
}

.footer-column ul li {
  margin-bottom: 6px;
}

.footer-column ul li a {
  color: var(--footer-text);
}

.footer-column ul li a:hover {
  text-decoration: underline;
}

.footer-divider {
  border-bottom: 1px solid var(--footer-border);
  margin-bottom: 17px;
  transition: border-color 0.3s;
}

.footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-legal-links a {
  color: var(--footer-text);
  margin: 0 7px;
}

.footer-legal-links a:hover {
  text-decoration: underline;
}

/* ---------- Video Hero ---------- */
.video-hero {
  position: relative;
  overflow: hidden;
  background-color: #000;
}

.video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
  z-index: 0;
  opacity: 0.7;
}

.video-hero .module-content {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}


/* ---------- Responsive ---------- */
@media only screen and (max-width: 1068px) {
  .headline { font-size: 48px; }
  .subhead { font-size: 24px; }
}

/* Ocultar botón de menú en desktop */
.globalnav-toggle {
  display: none;
}

@media only screen and (max-width: 734px) {
  /* Menu responsivo móvil */
  .globalnav {
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
  }
  
  .globalnav.globalnav-open {
    height: 100vh;
    background-color: var(--bg-color) !important; /* Fondo opaco en mobile */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .globalnav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
    padding: 0;
    margin-left: 15px;
  }

  .globalnav-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background-color: var(--text-color);
    transition: transform 0.25s ease, background-color 0.25s;
  }

  /* Animación del hamburguesa a X */
  .globalnav-toggle.active .line-1 {
    transform: translateY(3.25px) rotate(45deg);
  }
  .globalnav-toggle.active .line-2 {
    transform: translateY(-3.25px) rotate(-45deg);
  }

  .globalnav-list {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .globalnav.globalnav-open .globalnav-list {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    height: calc(100vh - 48px);
    padding: 40px 30px;
    box-sizing: border-box;
    gap: 28px;
    opacity: 1;
    z-index: 9998;
    background-color: var(--bg-color);
    align-items: flex-start;
  }

  .globalnav.globalnav-open .globalnav-list a {
    font-size: 26px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    display: block;
    width: 100%;
    opacity: 0.9;
  }
  
  .globalnav.globalnav-open .globalnav-list a:hover {
    opacity: 1;
    color: var(--brand-orange);
  }

  /* Ocultar acciones innecesarias en menú móvil expandido para mantenerlo limpio */
  .globalnav.globalnav-open .globalnav-actions svg {
    display: none;
  }

  .module-grid {
    grid-template-columns: 1fr; /* Stack grid on mobile */
    gap: 12px;
    margin: 12px 0;
  }
  
  .module-hero {
    height: 500px;
  }
  
  .module-hero:first-of-type {
    min-height: 500px;
  }
  
  .headline { font-size: 40px; }
  .subhead { font-size: 21px; }
  
  .module-tile {
    height: 500px;
  }
  
  .module-tile .headline { font-size: 32px; }
  .module-tile .subhead { font-size: 19px; }
}

/* ---------- Wholesale Side Tab ---------- */
.wholesale-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
}

/* Pestaña visible (vertical) */
.wholesale-tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: var(--brand-orange);
  color: #fff;
  padding: 18px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  transition: background-color 0.3s, padding 0.3s;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.15);
}

.wholesale-tab-label:hover {
  background: var(--brand-orange-hover);
}

/* Panel expandible */
.wholesale-tab-panel {
  width: 0;
  overflow: hidden;
  background: rgba(29, 29, 31, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px 0 0 12px;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  height: auto;
}

.wholesale-tab:hover .wholesale-tab-panel {
  width: 280px;
  padding: 24px 20px;
}

.wholesale-tab:hover .wholesale-tab-label {
  border-radius: 0;
}

.wholesale-tab-panel-inner {
  opacity: 0;
  transition: opacity 0.3s ease 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wholesale-tab:hover .wholesale-tab-panel-inner {
  opacity: 1;
}

.wholesale-tab-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-orange);
}

.wholesale-tab-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: normal;
}

.wholesale-tab-desc {
  font-size: 12px;
  color: #a1a1a6;
  line-height: 1.4;
  white-space: normal;
}

.wholesale-tab-btn {
  display: inline-block;
  background: var(--brand-orange);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
  margin-top: 4px;
  width: fit-content;
}

.wholesale-tab-btn:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

