/* ============================================================
   mobile.css — Mobile-First Complete Component Library
   Strictly implements Spec Section 5:
   5.1 Buttons (min 44px touch area, full width on mobile)
   5.2 Product Card (1:1 aspect ratio, typography, hover, badges)
   5.3 Badges (discount, new, limited, stock)
   5.4 Form Inputs (44px min height, #D1D5DB border, focus/error states)
   5.5 Navigation / Header (sticky, shadow on scroll, cart badge)
   5.6 Product Gallery (1:1 main image, 60px thumbs, swipe-ready)
   5.7 Floating WhatsApp Button (56x56px, fixed bottom-right)
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3) 0;
  transition: box-shadow var(--transition-fast);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-black);
  font-size: var(--text-xl);
  color: var(--color-primary);
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo img,
.site-logo-img {
  max-height: 48px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

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

.header-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text-main);
  border-radius: var(--radius-md);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.header-icon-btn:hover {
  background: var(--color-secondary);
}

.header-icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-offer);
  color: #ffffff;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.search-bar {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  z-index: 99;
}

.search-bar.open {
  display: flex;
  gap: var(--space-2);
}

.search-bar input {
  flex: 1;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  min-height: 44px;
  direction: rtl;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.search-bar button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  font-weight: var(--font-weight-bold);
  min-height: 44px;
}

.hero-banner {
  padding: var(--space-4) 0 var(--space-6) 0;
}

.hero-banner-image-wrap {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.hero-banner-image-wrap a {
  display: block;
  width: 100%;
  height: auto;
  text-decoration: none;
  cursor: pointer;
}

.hero-banner-image-wrap img,
.hero-banner-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-xl);
}

.hero-card {
  background: linear-gradient(135deg, var(--color-primary), #000000);
  color: #ffffff;
  padding: var(--space-8) var(--space-4);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-2);
  color: #ffffff;
}

.hero-subtitle {
  font-size: var(--text-base);
  opacity: 0.9;
  margin-bottom: var(--space-6);
  max-width: 600px;
  margin-inline: auto;
  line-height: var(--line-height-normal);
}

.categories-section {
  margin-bottom: var(--space-8);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-main);
}

.categories-scroll {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-main);
  background: var(--color-white);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  min-width: 96px;
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.category-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-chip-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.category-chip-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-chip-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: filter var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.btn:hover {
  filter: brightness(0.92);
}

.btn-primary {
  background: var(--color-button);
  color: var(--color-button-text);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-3);
}

.btn-ghost:hover {
  color: var(--color-text-main);
  background: var(--color-secondary);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-full {
  width: 100%;
}

.mobile-menu-toggle {
  display: flex !important;
}

.header-nav-desktop {
  display: none !important;
}

.desktop-nav-link {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-main);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: var(--space-6);
}

.product-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
  display: block;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.04);
}

.product-badges-overlay {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.product-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 0.875rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-main);
  margin-bottom: 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.4em;
}

.product-prices {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.product-prices .current-price {
  font-size: 0.95rem;
  font-weight: var(--font-weight-black);
  color: var(--color-button);
}

.product-prices .original-price {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-decoration: line-through;
}

.product-card-btn {
  margin-top: auto;
}

.product-card-btn .btn {
  min-height: 38px;
  font-size: 0.8rem;
  font-weight: var(--font-weight-black);
  padding: 0 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  white-space: nowrap;
}

.badge-discount,
.discount-badge {
  background: var(--color-offer);
  color: #ffffff;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
}

.badge-featured {
  background: var(--color-primary);
  color: #ffffff;
}

.badge-free-shipping {
  background: var(--color-success);
  color: #ffffff;
}

.badge-limited-stock {
  color: var(--color-error);
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.badge-in-stock {
  color: var(--color-success);
  background: rgba(40, 167, 69, 0.12);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-main);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-main);
  font-size: var(--text-base);
  direction: rtl;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: var(--color-error);
}

.form-error-msg {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-1);
  display: block;
}

.product-page-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.product-order-column {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.gallery-main {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  max-height: 520px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-thumbs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}

.gallery-thumb-btn {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-white);
  cursor: pointer;
  padding: 0;
  transition: border-color var(--transition-fast);
}

.gallery-thumb-btn.active,
.gallery-thumb-btn:hover {
  border-color: var(--color-primary);
}

.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.whatsapp-float {
  position: fixed;
  bottom: 84px;
  left: var(--space-4);
  right: auto;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.45);
  z-index: 99;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.55);
}

body.checkout-page .whatsapp-float {
  display: none !important;
}

.mobile-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 10px var(--space-4);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  z-index: 90;
}

.mobile-sticky-bar .sticky-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
}

.mobile-sticky-bar .btn {
  margin: 0;
  flex-shrink: 0;
}

.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: var(--space-12) 0 var(--space-6);
  margin-top: var(--space-12);
}

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

.footer-heading {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-3);
  color: #ffffff;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  color: rgba(255,255,255,0.75);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  text-align: center;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-4);
}
