/* ============================================
   CHROCHELY CREATIONS — Layout Components
   Navbar, Footer, Cart Drawer, Modals, Search
   ============================================ */

/* ══════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--white-90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-sticky);
  transition: all var(--duration-normal) var(--ease-smooth);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  box-shadow: var(--shadow-nav);
  border-bottom-color: rgba(231,215,201,0.4);
}

.navbar-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.navbar-brand-text {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--brown-dark);
  letter-spacing: var(--ls-tight);
}

.navbar-brand-tagline {
  font-size: var(--fs-xs);
  color: var(--brown-light);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  font-weight: var(--fw-medium);
  display: block;
  margin-top: -2px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar-link {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--brown);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-smooth);
  letter-spacing: var(--ls-wide);
  position: relative;
  text-decoration: none;
}

.navbar-link:hover { color: var(--brown-dark); background: var(--cream); }
.navbar-link.active { color: var(--brown-dark); font-weight: var(--fw-semibold); }
.navbar-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--brown);
  border-radius: var(--radius-full);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  transition: all var(--duration-fast) var(--ease-smooth);
  cursor: pointer;
  background: none;
  border: none;
}

.navbar-cart-btn:hover { background: var(--cream); }
.navbar-cart-btn svg { width: 22px; height: 22px; }

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--rose);
  color: var(--white);
  font-size: 10px;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-badge:empty { display: none; }

.navbar-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  cursor: pointer;
  background: none;
  border: none;
}

.navbar-menu-btn svg { width: 24px; height: 24px; }

/* ── Mobile Navigation ── */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: var(--white-90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-sticky);
  display: none;
  border-top: 1px solid rgba(231,215,201,0.4);
  box-shadow: 0 -2px 20px rgba(139,107,97,0.06);
}

.mobile-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  padding: 0 var(--space-2);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2);
  color: var(--brown-light);
  transition: color var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-heading);
}

.mobile-nav-item:hover, .mobile-nav-item.active { color: var(--brown-dark); }
.mobile-nav-item svg { width: 22px; height: 22px; }
.mobile-nav-item span { font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: var(--ls-wide); }

.mobile-nav-item .cart-badge {
  top: 0;
  right: -4px;
}

/* ── Mobile Menu Drawer ── */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  pointer-events: none;
}

.mobile-menu.open { pointer-events: auto; }

.mobile-menu-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.mobile-menu.open .mobile-menu-overlay { opacity: 1; }

.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 360px;
  background: var(--white);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-smooth);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }

.mobile-menu-header {
  padding: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--warm-beige);
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  cursor: pointer;
  background: none;
  border: none;
}

.mobile-menu-close:hover { background: var(--cream); }
.mobile-menu-close svg { width: 24px; height: 24px; }

.mobile-menu-links {
  padding: var(--space-4) 0;
  flex: 1;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--brown);
  transition: all var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
}

.mobile-menu-link:hover { background: var(--cream); color: var(--brown-dark); }
.mobile-menu-link svg { width: 20px; height: 20px; color: var(--brown-light); }

.mobile-menu-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--warm-beige);
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.footer {
  background: var(--cream);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--footer-gap);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--warm-beige), transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-brand p {
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  transition: all var(--duration-fast) var(--ease-smooth);
  box-shadow: var(--shadow-xs);
}

.footer-social-link:hover {
  background: var(--brown);
  color: var(--cream-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.footer-social-link svg { width: 18px; height: 18px; }

.footer-column h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--brown-dark);
  margin-bottom: var(--space-5);
}

.footer-links { display: flex; flex-direction: column; gap: var(--space-3); }

.footer-link {
  font-size: var(--fs-sm);
  color: var(--brown-light);
  transition: color var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
}

.footer-link:hover { color: var(--brown-dark); }

.footer-bottom {
  border-top: 1px solid var(--warm-beige);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--brown-light);
}

.footer-bottom a { color: var(--brown-light); }
.footer-bottom a:hover { color: var(--brown); }

.footer-heart { color: var(--error); }

/* ══════════════════════════════════════
   CART DRAWER
   ══════════════════════════════════════ */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  pointer-events: none;
}

.cart-drawer.open { pointer-events: auto; }

.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.cart-drawer.open .cart-drawer-overlay { opacity: 1; }

.cart-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100%;
  background: var(--white);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-smooth);
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.cart-drawer.open .cart-drawer-panel { transform: translateX(0); }

.cart-drawer-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--warm-beige);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cart-drawer-title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--brown-dark);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cart-drawer-count {
  background: var(--cream);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  color: var(--brown-light);
}

.cart-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  cursor: pointer;
  background: none;
  border: none;
  transition: background var(--duration-fast) var(--ease-smooth);
}

.cart-drawer-close:hover { background: var(--cream); }
.cart-drawer-close svg { width: 22px; height: 22px; }

.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
}

.cart-drawer-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid rgba(231,215,201,0.4);
}

.cart-drawer-item:last-child { border-bottom: none; }

.cart-drawer-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--cream);
}

.cart-drawer-item-image img { width: 100%; height: 100%; object-fit: cover; }

.cart-drawer-item-info { flex: 1; min-width: 0; }

.cart-drawer-item-name {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--brown-dark);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-drawer-item-variant {
  font-size: var(--fs-xs);
  color: var(--brown-light);
  margin-bottom: var(--space-2);
}

.cart-drawer-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-item-price {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  color: var(--brown-dark);
}

.cart-drawer-item-remove {
  color: var(--brown-light);
  cursor: pointer;
  padding: var(--space-1);
  background: none;
  border: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.cart-drawer-item-remove:hover { color: var(--error); }
.cart-drawer-item-remove svg { width: 16px; height: 16px; }

.cart-drawer-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-10);
}

.cart-drawer-empty svg { width: 80px; height: 80px; color: var(--warm-beige); margin-bottom: var(--space-6); }
.cart-drawer-empty h3 { font-size: var(--fs-xl); margin-bottom: var(--space-2); }
.cart-drawer-empty p { font-size: var(--fs-sm); color: var(--brown-light); margin-bottom: var(--space-6); }

.cart-drawer-footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--warm-beige);
  background: var(--cream-light);
  flex-shrink: 0;
}

.cart-drawer-subtotal {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--brown-light);
}

.cart-drawer-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--brown-dark);
}

.cart-drawer-footer .btn { width: 100%; margin-bottom: var(--space-2); }
.cart-drawer-footer .btn:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════
   SEARCH MODAL
   ══════════════════════════════════════ */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  pointer-events: none;
}

.search-modal.open { pointer-events: auto; }

.search-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248,243,238,0.95);
  backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.search-modal.open .search-modal-overlay { opacity: 1; }

.search-modal-content {
  position: relative;
  max-width: 640px;
  margin: 15vh auto 0;
  padding: 0 var(--space-5);
  transform: translateY(-20px);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.search-modal.open .search-modal-content { transform: translateY(0); opacity: 1; }

.search-modal-input-wrap {
  position: relative;
  margin-bottom: var(--space-6);
}

.search-modal-input {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  padding-left: var(--space-12);
  font-size: var(--fs-xl);
  font-family: var(--font-heading);
  background: var(--white);
  border: 2px solid var(--warm-beige);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  color: var(--brown-dark);
}

.search-modal-input:focus { border-color: var(--brown-light); }
.search-modal-input::placeholder { color: var(--warm-tan); }

.search-modal-icon {
  position: absolute;
  left: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--brown-light);
}

.search-modal-icon svg { width: 24px; height: 24px; }

.search-modal-close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  cursor: pointer;
  background: var(--white);
  border: none;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.search-modal-close:hover { background: var(--cream); }
.search-modal-close svg { width: 22px; height: 22px; }

.search-results {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 50vh;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
  color: inherit;
}

.search-result-item:hover { background: var(--cream); }

.search-result-image {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--cream);
}

.search-result-image img { width: 100%; height: 100%; object-fit: cover; }

.search-result-name {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--brown-dark);
}

.search-result-price {
  font-size: var(--fs-sm);
  color: var(--brown-light);
  margin-top: 2px;
}

.search-no-results {
  padding: var(--space-10);
  text-align: center;
  color: var(--brown-light);
}

/* ══════════════════════════════════════
   GENERIC MODAL
   ══════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  pointer-events: none;
}

.modal.open { pointer-events: auto; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.modal.open .modal-overlay { opacity: 1; }

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-modal);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-smooth);
  z-index: 2;
}

.modal.open .modal-content { transform: scale(1) translateY(0); opacity: 1; }

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--warm-beige);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--brown-dark);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown-light);
  cursor: pointer;
  background: none;
  border: none;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.modal-close:hover { background: var(--cream); color: var(--brown); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ══════════════════════════════════════
   FLOATING WHATSAPP BUTTON
   ══════════════════════════════════════ */
.whatsapp-float {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: #25D366;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
  cursor: pointer;
  z-index: var(--z-sticky);
  transition: all var(--duration-fast) var(--ease-smooth);
  border: none;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,211,102,0.4);
  color: var(--white);
}

.whatsapp-float svg { width: 28px; height: 28px; }

/* ── Responsive Layout ── */
@media (max-width: 768px) {
  .navbar { height: var(--mobile-nav-height); }
  .navbar-nav { display: none; }
  .navbar-menu-btn { display: flex; }
  .mobile-nav { display: block; }
  .navbar-brand-tagline { display: none; }
  .navbar-brand-text { font-size: var(--fs-lg); }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: var(--space-3); text-align: center; }

  .cart-drawer-panel { width: 100%; max-width: 100%; }

  .whatsapp-float {
    bottom: calc(var(--mobile-nav-height) + var(--space-4));
    width: 52px;
    height: 52px;
  }

  body { padding-bottom: var(--mobile-nav-height); }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
