/* ═══════════════════════════════════════════════════════════════════════════
   ELAAF — Component Styles
   Buttons, Forms, Cards, Nav, Footer, Product Card, etc.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════
   BUTTONS
   ════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary */
.btn--primary {
  background: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}
.btn--primary:hover:not(:disabled) {
  background: var(--clr-accent-dark);
  border-color: var(--clr-accent-dark);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

/* Outline */
.btn--outline {
  background: transparent;
  color: var(--clr-accent);
  border-color: var(--clr-accent);
}
.btn--outline:hover:not(:disabled) {
  background: var(--clr-accent);
  color: #fff;
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--clr-text);
  border-color: var(--clr-muted-2);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--clr-muted);
  border-color: var(--clr-muted-2);
}

/* Dark */
.btn--dark {
  background: var(--clr-text);
  color: #fff;
  border-color: var(--clr-text);
}
.btn--dark:hover:not(:disabled) {
  background: #333;
  border-color: #333;
}

/* Accent */
.btn--accent {
  background: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}
.btn--accent:hover:not(:disabled) {
  background: var(--clr-accent-dark);
  border-color: var(--clr-accent-dark);
}

/* Sizes */
.btn--sm  { padding: 0.5rem 1.25rem; font-size: var(--text-xs); }
.btn--lg  { padding: 1rem 2.5rem;   font-size: var(--text-base); }
.btn--xl  { padding: 1.125rem 3rem; font-size: var(--text-md); }
.btn--full { width: 100%; }

/* Icon Button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover {
  background: var(--clr-muted);
  color: var(--clr-accent);
}
.btn-icon--circle { border-radius: 50%; }

/* Ripple effect on click */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.2);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:active::after { opacity: 1; }

/* ════════════════════════════════
   FORMS
   ════════════════════════════════ */
.form-group {
  margin-bottom: var(--space-5);
}
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clr-text);
  margin-bottom: var(--space-2);
}
.form-label--required::after {
  content: ' *';
  color: var(--clr-error);
}
.form-control {
  width: 100%;
  padding: 0.75rem var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--clr-text);
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-muted-2);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-light);
}
.form-control::placeholder { color: var(--clr-text-faint); }
.form-control--error { border-color: var(--clr-error); }
.form-control--error:focus { box-shadow: 0 0 0 3px var(--clr-error-bg); }

textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: var(--space-1);
}
.form-error {
  font-size: var(--text-xs);
  color: var(--clr-error);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--clr-accent);
  cursor: pointer;
}
.form-check__label {
  font-size: var(--text-sm);
  color: var(--clr-text);
  cursor: pointer;
}

/* Search Input */
.search-box {
  position: relative;
}
.search-box__input {
  padding-left: 2.75rem;
  background: #ffffff !important;
  color: var(--clr-text) !important;
  border: 1px solid var(--clr-border) !important;
}
.search-box__icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-text-muted);
  pointer-events: none;
}

/* ════════════════════════════════
   HEADER / NAVIGATION
   ════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--clr-surface);
  border-bottom: var(--border);
  box-shadow: var(--shadow-xs);
}
.header-top {
  background: var(--clr-accent);
  color: rgba(255,255,255,0.9);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-align: center;
  padding: var(--space-2) var(--space-4);
}
.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  height: var(--header-height);
  padding-inline: var(--space-6);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.site-logo__text {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--clr-accent);
  letter-spacing: var(--tracking-wide);
  line-height: 1;
}
.site-logo__tagline {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

/* Main Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.nav-item {
  position: relative;
}
.nav-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clr-text);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.is-active {
  color: var(--clr-accent);
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  min-width: 200px;
  background: var(--clr-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  padding: var(--space-2) 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: var(--z-dropdown);
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.nav-dropdown__link {
  display: block;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  transition: all var(--transition);
}
.nav-dropdown__link:hover {
  background: var(--clr-muted);
  color: var(--clr-accent);
  padding-left: var(--space-6);
}

/* ── More dropdown: has-sub item (flyout right panel) ─────────────────── */
.nav-dropdown__link--has-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-dropdown__link--has-sub:hover {
  padding-left: var(--space-6);
}

/* nav-more-item wraps a parent + its flyout sub panel */
.nav-more-item {
  position: relative;
}

/* The flyout sub-panel: hidden by default, slides right */
.nav-more-sub {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 200px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--clr-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  padding: var(--space-2) 0;
  z-index: calc(var(--z-dropdown) + 10);
}

/* Show flyout on hover of the parent item */
.nav-more-item:hover .nav-more-sub {
  display: block;
}

/* Scrollbar styling for More dropdown */
.nav-dropdown--more::-webkit-scrollbar,
.nav-more-sub::-webkit-scrollbar {
  width: 4px;
}
.nav-dropdown--more::-webkit-scrollbar-track,
.nav-more-sub::-webkit-scrollbar-track {
  background: transparent;
}
.nav-dropdown--more::-webkit-scrollbar-thumb,
.nav-more-sub::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 4px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.header-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  transition: all var(--transition);
  border: none;
  background: transparent;
  cursor: pointer;
}
.header-action-btn:hover {
  color: var(--clr-accent);
  background: var(--clr-muted);
}
.cart-count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  background: var(--clr-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: var(--space-2);
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: all var(--transition);
}
.nav-toggle.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Drawer */
.mobile-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(80vw, 340px);
  background: var(--clr-surface);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}
.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-2);
  font-size: var(--text-base);
  font-weight: 500;
  border-bottom: var(--border);
  color: var(--clr-text);
  transition: color var(--transition);
}
.mobile-nav__link:hover { color: var(--clr-accent); }

/* ════════════════════════════════
   PRODUCT CARD
   ════════════════════════════════ */
.product-card {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.product-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--clr-muted);
}
.product-card__media a {
  display: block;
  width: 100%;
  height: 100%;
}
.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.product-card:hover .product-card__img {
  transform: scale(1.06);
}
.product-card__img-alt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.product-card:hover .product-card__img-alt {
  opacity: 1;
}

.product-card__badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 1;
}

.product-card__actions {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  opacity: 0;
  transform: translateX(10px);
  transition: all var(--transition);
  z-index: 1;
}
.product-card:hover .product-card__actions {
  opacity: 1;
  transform: translateX(0);
}
.product-card__action-btn {
  width: 36px;
  height: 36px;
  background: var(--clr-surface);
  border: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--clr-text);
  transition: all var(--transition);
  font-size: 14px;
}
.product-card__action-btn:hover {
  background: var(--clr-accent);
  color: #fff;
}
.product-card__action-btn.is-wishlisted {
  background: var(--clr-accent-light);
  color: var(--clr-accent);
}

.product-card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card__category {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.product-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: var(--leading-snug);
  color: var(--clr-text);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__name a:hover { color: var(--clr-accent); }

.product-card__footer {
  margin-top: auto;
}
.product-card__add {
  width: 100%;
  margin-top: var(--space-3);
  padding: 0.625rem;
  font-size: var(--text-xs);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition);
}
.product-card:hover .product-card__add {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════
   FOOTER
   ════════════════════════════════ */
.site-footer {
  background: var(--clr-text);
  color: rgba(255,255,255,0.75);
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding: var(--space-20) var(--space-6);
  max-width: var(--container-wide);
  margin-inline: auto;
}
.footer-brand__logo {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #fff;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-4);
}
.footer-brand__desc {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  color: rgba(255,255,255,0.6);
}
.footer-social {
  display: flex;
  gap: var(--space-3);
}
.footer-social__link {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: var(--text-base);
  transition: all var(--transition);
}
.footer-social__link:hover {
  background: var(--clr-accent);
  color: #fff;
}

.footer-col__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--space-5);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--clr-accent); }

/* Newsletter in footer */
.footer-newsletter__form {
  display: flex;
  margin-top: var(--space-4);
}
.footer-newsletter__input {
  flex: 1;
  padding: 0.75rem var(--space-4);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: #fff;
  font-size: var(--text-sm);
  outline: none;
}
.footer-newsletter__input::placeholder { color: rgba(255,255,255,0.4); }
.footer-newsletter__input:focus { border-color: var(--clr-accent); }
.footer-newsletter__btn {
  padding: 0.75rem var(--space-5);
  background: var(--clr-accent);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.footer-newsletter__btn:hover { background: var(--clr-accent-dark); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
}

/* ════════════════════════════════
   TABLES (Admin & Account)
   ════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: var(--border);
}
.data-table {
  width: 100%;
  font-size: var(--text-sm);
}
.data-table thead {
  background: var(--clr-muted);
}
.data-table th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--clr-text-muted);
  white-space: nowrap;
}
.data-table td {
  padding: var(--space-4) var(--space-5);
  border-top: var(--border);
  vertical-align: middle;
  color: var(--clr-text);
}
.data-table tbody tr:hover td {
  background: var(--clr-muted);
}
.data-table img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* ════════════════════════════════
   ORDER STATUS BADGE
   ════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge--pending          { background: #FEF3C7; color: #92400E; }
.status-badge--confirmed        { background: #EFF6FF; color: #1D4ED8; }
.status-badge--processing       { background: #F5F3FF; color: #6D28D9; }
.status-badge--packaging        { background: #FFF7ED; color: #C2410C; }
.status-badge--ready_for_dispatch { background: #ECFDF5; color: #065F46; }
.status-badge--shipped          { background: #F0FDF4; color: #15803D; }
.status-badge--out_for_delivery { background: #EFF6FF; color: #1E40AF; }
.status-badge--delivered        { background: #DCFCE7; color: #166534; }
.status-badge--cancelled        { background: #FEE2E2; color: #991B1B; }
.status-badge--returned         { background: #F3F4F6; color: #4B5563; }

/* ════════════════════════════════
   ORDER TRACKING TIMELINE
   ════════════════════════════════ */
.tracking-timeline {
  position: relative;
  padding-left: var(--space-8);
}
.tracking-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--clr-muted-2);
}
.timeline-step {
  position: relative;
  padding-bottom: var(--space-8);
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step__dot {
  position: absolute;
  left: -29px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--clr-muted-2);
  border: 2px solid var(--clr-surface);
  box-shadow: 0 0 0 2px var(--clr-muted-2);
}
.timeline-step.is-done .timeline-step__dot {
  background: var(--clr-accent);
  box-shadow: 0 0 0 2px var(--clr-accent-light);
}
.timeline-step.is-current .timeline-step__dot {
  background: var(--clr-accent);
  box-shadow: 0 0 0 4px var(--clr-accent-light);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px var(--clr-accent-light); }
  50%       { box-shadow: 0 0 0 8px rgba(123, 31, 46, 0.1); }
}
.timeline-step__status {
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: capitalize;
  margin-bottom: var(--space-1);
}
.timeline-step__time {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}
.timeline-step__notes {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--clr-muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--clr-accent);
}
