/* ==========================================================================
   KEMET ATELIER — Unified Brand Design System & Components
   Contemporary Egyptian Menswear & Spatial Commerce
   Warm sand/beige identity matching the 3D Fit Studio background (#e9e4dc)
   ========================================================================== */

/* Header & Navigation Bar */
.brand-header {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  z-index: 100;
  width: min(1200px, calc(100vw - 32px));
  height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  contain: layout style;
  backface-visibility: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
}

/* On warm-beige pages, header uses Apple Liquid Glass */
.page-wrapper .brand-header {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72) 0%, rgba(246, 242, 235, 0.52) 50%, rgba(235, 229, 220, 0.45) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 12px 32px -8px rgba(44, 40, 36, 0.08),
    0 4px 12px rgba(44, 40, 36, 0.04),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px 0 rgba(44, 40, 36, 0.04);
}

.brand-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  color: #fff;
  font-family: var(--sans);
  letter-spacing: .08em;
  transition: opacity .2s;
}

.page-wrapper .brand-logo {
  color: #2c2824;
}

.brand-logo:hover {
  opacity: .85;
}

.logo-main {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .16em;
}

.logo-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .25em;
  color: rgba(255, 255, 255, .7);
  text-transform: uppercase;
}

.page-wrapper .logo-sub {
  color: rgba(44, 40, 36, .55);
}

.brand-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  text-decoration: none;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  transition: all .25s var(--ease);
  white-space: nowrap;
}

.page-wrapper .nav-link {
  color: rgba(44, 40, 36, .7);
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .15);
}

.page-wrapper .nav-link:hover {
  color: #2c2824;
  background: rgba(44, 40, 36, .08);
}

.nav-link.active {
  background: rgba(255, 255, 255, .92);
  color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.page-wrapper .nav-link.active {
  background: #2c2824;
  color: #f5f1eb;
  box-shadow: 0 2px 8px rgba(44, 40, 36, .2);
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-trigger-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
  text-decoration: none;
  transition: transform .2s, background .2s;
}

.page-wrapper .cart-trigger-btn {
  background: rgba(44, 40, 36, .08);
  border: 1px solid rgba(44, 40, 36, .2);
  color: #2c2824;
}

.cart-trigger-btn:hover {
  background: rgba(255, 255, 255, .28);
  transform: scale(1.05);
}

.page-wrapper .cart-trigger-btn:hover {
  background: rgba(44, 40, 36, .15);
}

.cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #2c2824;
  color: #f5f1eb;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e9e4dc;
}

/* Toast Notifications */
.kemet-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 60px);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #2c2824;
  background: rgba(233,228,220,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(180, 170, 155, .4);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s var(--ease), opacity .35s ease;
  box-shadow: 0 16px 36px -10px rgba(80, 60, 30, .25);
}

.kemet-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* Base Page Template Containers */
.page-wrapper {
  min-height: 100vh;
  width: 100%;
  background: #e9e4dc;
  color: #2c2824;
  font-family: var(--sans);
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 86px;
  padding-bottom: 60px;
}

.container {
  width: min(1200px, calc(100vw - 40px));
  margin: 0 auto;
}

/* ==========================================================================
   Apple Liquid Glass (Frosted Refraction, Specular Rims & Multi-Depth Shadows)
   Preserves the original warm sand & bronze Egyptian identity palette:
   Background: #e9e4dc | Text: #2c2824 | Accents: Warm bronze & crystal luster
   ========================================================================== */

.page-wrapper .glass,
.glass-liquid-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68) 0%, rgba(246, 242, 235, 0.48) 50%, rgba(235, 229, 220, 0.42) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 16px 36px -6px rgba(44, 40, 36, 0.08),
    0 4px 12px rgba(44, 40, 36, 0.04),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px 0 rgba(44, 40, 36, 0.04);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.35s ease,
              border-color 0.35s ease;
}

.page-wrapper .glass:hover,
.glass-liquid-panel:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.85) 0%, rgba(248, 244, 237, 0.62) 50%, rgba(238, 233, 224, 0.52) 100%);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 24px 50px -10px rgba(44, 40, 36, 0.12),
    0 8px 20px rgba(44, 40, 36, 0.06),
    inset 0 2px 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 1px 0 rgba(44, 40, 36, 0.04);
}

/* Apple Liquid Glass Buttons — Secondary (Frosted Glass with Specular Edge) */
.btn-secondary,
.btn-liquid-secondary,
.btn-try-spatial,
.cart-item-tryon,
.filter-pill,
.sort-select,
.qty-btn,
.empty-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.38) 100%), rgba(44, 40, 36, 0.03);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #2c2824;
  box-shadow:
    0 4px 14px rgba(44, 40, 36, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(44, 40, 36, 0.04);
  font-family: var(--sans);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover,
.btn-liquid-secondary:hover,
.btn-try-spatial:hover,
.cart-item-tryon:hover,
.filter-pill:hover,
.qty-btn:hover,
.empty-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.58) 100%), rgba(44, 40, 36, 0.05);
  border-color: #ffffff;
  color: #1a1714;
  box-shadow:
    0 8px 22px rgba(44, 40, 36, 0.10),
    inset 0 1.5px 1px rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

/* Apple Liquid Glass Buttons — Primary (Warm Espresso with Specular Reflection) */
.btn-primary,
.btn-liquid-primary,
.btn-main-add,
.buy-action-btn,
#placeOrderBtn,
.filter-pill.active {
  background: linear-gradient(180deg, #3d3732 0%, #221e1a 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f7f4ee;
  box-shadow:
    0 6px 20px rgba(44, 40, 36, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -1px 1px rgba(0, 0, 0, 0.3);
  font-family: var(--sans);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover,
.btn-liquid-primary:hover,
.btn-main-add:hover,
.buy-action-btn:hover,
#placeOrderBtn:not(:disabled):hover {
  background: linear-gradient(180deg, #48413b 0%, #2c2723 100%);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow:
    0 10px 28px rgba(44, 40, 36, 0.32),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.65);
  transform: translateY(-2px);
}

/* Global Footer */
.brand-footer {
  margin-top: 80px;
  padding: 50px 0 30px;
  border-top: 1px solid rgba(44, 40, 36, 0.1);
  color: rgba(44, 40, 36, 0.6);
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand h4 {
  font-size: 18px;
  font-weight: 800;
  color: #2c2824;
  letter-spacing: .12em;
  margin-bottom: 10px;
}

.footer-col h5 {
  font-size: 14px;
  font-weight: 700;
  color: #2c2824;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  color: rgba(44, 40, 36, 0.6);
  text-decoration: none;
  transition: color .2s;
}

.footer-col a:hover {
  color: #2c2824;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 25px;
  border-top: 1px solid rgba(44, 40, 36, 0.08);
  font-size: 12px;
}

.eg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(44, 40, 36, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #2c2824;
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .brand-header {
    top: 8px;
    height: 44px;
    padding: 0 10px;
    width: calc(100vw - 16px);
    box-sizing: border-box;
  }

  .logo-main {
    font-size: 13px;
    letter-spacing: .12em;
  }

  .logo-sub {
    display: none;
  }

  .brand-nav {
    gap: 3px;
  }

  .nav-link {
    padding: 4px 8px;
    font-size: 11px;
  }

  .cart-trigger-btn {
    width: 32px;
    height: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}
