/* ============================================================
   Texotize Store — Store & Checkout Styles
   ============================================================ */

/* Store header — uses div not header tag to avoid styles.css global header rule */
.store-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 1px 8px rgba(15,23,42,.06);
}

/* Cart badge in nav */
.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--primary-color, #2563EB);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Store Layout ─────────────────────────────────────────── */
.store-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 768px) {
  .store-layout { grid-template-columns: 1fr; }
}

.store-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.store-search-form .form-control { flex: 1; }

.store-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.product-count { font-size: 14px; color: #64748B; margin: 0; }

/* ── Sidebar ──────────────────────────────────────────────── */
.store-sidebar { position: sticky; top: 100px; }
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748B;
  margin-bottom: 12px;
}
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li + li { border-top: 1px solid #F1F5F9; }
.cat-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
  transition: color .2s;
}
.cat-link:hover, .cat-link.active { color: var(--primary-color, #2563EB); font-weight: 600; }
.cat-count { font-size: 12px; color: #94A3B8; }
.sidebar-widget { background: #F8FAFC; border-radius: 10px; padding: 16px; }

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  position: relative;
}
.product-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }

.badge-featured, .badge-sale {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  z-index: 1;
}
.badge-featured { background: #2563EB; color: #fff; }
.badge-sale      { background: #EF4444; color: #fff; left: auto; right: 10px; }

.product-card-img-link { display: block; }
.product-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.product-card-body { padding: 14px; }
.product-cat-label { font-size: 11px; color: #64748B; text-transform: uppercase; letter-spacing: .04em; }
.product-card-name { font-size: 15px; font-weight: 600; margin: 4px 0 6px; line-height: 1.4; }
.product-card-name a { color: #0F172A; text-decoration: none; }
.product-card-name a:hover { color: var(--primary-color, #2563EB); }
.product-card-desc { font-size: 12px; color: #64748B; margin-bottom: 10px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.price-original, .price-original-lg { text-decoration: line-through; color: #94A3B8; font-size: 13px; }
.price-sale, .price-sale-lg { color: #10B981; font-weight: 700; }
.price-regular, .price-regular-lg { font-weight: 700; color: #0F172A; }
.price-sale-lg, .price-regular-lg { font-size: 24px; }
.price-original-lg { font-size: 16px; }

.out-of-stock-badge { font-size: 12px; color: #EF4444; font-weight: 600; }
.out-of-stock-notice { color: #EF4444; font-weight: 600; margin: 16px 0; }
.stock-notice { font-size: 13px; color: #64748B; margin: 8px 0 0; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #64748B;
}
.empty-state p { margin: 16px 0 24px; font-size: 15px; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  text-decoration: none;
  transition: all .2s;
}
.page-btn:hover, .page-btn.active { background: var(--primary-color, #2563EB); color: #fff; border-color: transparent; }

/* ── Product Detail ───────────────────────────────────────── */
.breadcrumb { font-size: 13px; color: #64748B; margin-bottom: 28px; }
.breadcrumb a { color: var(--primary-color, #2563EB); text-decoration: none; }

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 768px) { .product-detail-layout { grid-template-columns: 1fr; } }

.product-main-img { width: 100%; border-radius: 12px; object-fit: cover; max-height: 420px; }
.product-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.product-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid #E2E8F0; transition: border-color .2s; }
.product-thumb:hover { border-color: var(--primary-color, #2563EB); }
.product-no-img { height: 300px; background: #F8FAFC; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #94A3B8; }

.product-detail-title { font-size: 28px; margin: 6px 0 12px; }
.product-sku { font-size: 12px; color: #94A3B8; margin-bottom: 12px; }
.product-price-large { margin: 16px 0; }
.product-short-desc { font-size: 15px; color: #334155; margin-bottom: 20px; line-height: 1.7; }

.qty-add-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.qty-selector, .qty-selector-sm { display: flex; align-items: center; border: 1px solid #E2E8F0; border-radius: 8px; overflow: hidden; }
.qty-btn { background: #F8FAFC; border: none; padding: 8px 14px; font-size: 18px; cursor: pointer; color: #334155; transition: background .2s; }
.qty-btn:hover { background: #E2E8F0; }
.qty-field { width: 50px; border: none; text-align: center; font-size: 15px; padding: 8px 4px; outline: none; }
.qty-field-sm { width: 40px; border: none; text-align: center; font-size: 14px; padding: 6px 2px; outline: none; }
.qty-selector-sm .qty-btn { padding: 6px 10px; font-size: 15px; }

.product-full-desc h2 { font-size: 20px; margin-bottom: 16px; }
.product-desc-body { font-size: 15px; color: #334155; line-height: 1.8; }

/* ── Cart ─────────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 768px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { padding: 10px 12px; text-align: left; font-size: 12px; color: #64748B; text-transform: uppercase; border-bottom: 2px solid #E2E8F0; }
.cart-table td { padding: 14px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; font-size: 14px; }

.cart-product-cell { display: flex; align-items: center; gap: 10px; }
.cart-item-img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }

.cart-remove-btn { background: none; border: none; color: #94A3B8; font-size: 16px; cursor: pointer; padding: 4px 8px; transition: color .2s; }
.cart-remove-btn:hover { color: #EF4444; }

.cart-totals-box { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; padding: 24px; }
.cart-totals { margin-bottom: 16px; }
.total-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: #334155; border-bottom: 1px solid #E2E8F0; }
.total-row:last-child { border-bottom: none; }
.total-grand { font-size: 18px; font-weight: 700; color: #0F172A; }

/* ── Checkout ─────────────────────────────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-section-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.checkout-form-col, .checkout-summary-col { }

.cart-summary-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.cart-summary-name { color: #334155; }
.cart-summary-price { font-weight: 600; }
.qty-badge { background: #E2E8F0; border-radius: 4px; padding: 1px 6px; font-size: 11px; margin-left: 4px; }

/* ── Order pages ──────────────────────────────────────────── */
.success-icon { font-size: 56px; color: #10B981; display: block; margin-bottom: 16px; }

.order-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; }
.order-card-header { display: flex; gap: 32px; flex-wrap: wrap; padding: 20px 24px; background: #F8FAFC; border-bottom: 1px solid #E2E8F0; }
.order-meta-label { font-size: 11px; color: #94A3B8; text-transform: uppercase; margin-bottom: 4px; }
.order-meta-value { font-size: 15px; font-weight: 600; color: #0F172A; }

.order-items-table { width: 100%; border-collapse: collapse; }
.order-items-table th { padding: 10px 16px; text-align: left; font-size: 12px; color: #64748B; text-transform: uppercase; background: #F8FAFC; border-bottom: 1px solid #E2E8F0; }
.order-items-table td { padding: 12px 16px; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.order-items-table tfoot td { padding: 10px 16px; font-size: 14px; color: #64748B; }
.total-grand-row td { font-weight: 700; color: #0F172A; font-size: 16px; border-top: 2px solid #E2E8F0; }

/* ── Tracking ─────────────────────────────────────────────── */
.tracking-form { margin-bottom: 32px; }

.tracking-progress {
  display: flex;
  align-items: center;
  padding: 24px;
  overflow-x: auto;
  gap: 0;
}
.tracking-step { text-align: center; min-width: 80px; }
.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #94A3B8;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  margin: 0 auto 6px;
  transition: all .3s;
}
.tracking-step.done .step-circle  { background: #10B981; color: #fff; }
.tracking-step.current .step-circle { background: #2563EB; color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
.step-label { font-size: 11px; color: #64748B; }
.tracking-step.done .step-label, .tracking-step.current .step-label { color: #0F172A; font-weight: 600; }
.step-line { flex: 1; height: 2px; background: #E2E8F0; min-width: 24px; transition: background .3s; }
.step-line.done { background: #10B981; }

.tracking-history { list-style: none; padding: 0; margin: 0; }
.tracking-event { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.tracking-event:last-child { border-bottom: none; }
.tracking-event-dot { width: 10px; height: 10px; border-radius: 50%; background: #2563EB; margin-top: 5px; flex-shrink: 0; }
.tracking-event-time { display: block; font-size: 12px; color: #94A3B8; margin-top: 2px; }

/* ── Auth Tabs ────────────────────────────────────────────── */
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #E2E8F0; }
.auth-tab { background: none; border: none; padding: 10px 24px; font-size: 15px; font-weight: 600; color: #64748B; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: var(--primary-color, #2563EB); border-bottom-color: var(--primary-color, #2563EB); }
.auth-form-wrap { padding-top: 8px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert-error {
  padding: 14px 16px;
  background: rgba(239,68,68,.08);
  color: #991B1B;
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-success {
  padding: 14px 16px;
  background: rgba(16,185,129,.08);
  color: #065F46;
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Toast ────────────────────────────────────────────────── */
.cart-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  max-width: 320px;
}
.cart-toast.show { opacity: 1; transform: translateY(0); }

/* ── Status Badges ────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}
.status-pending    { background: #FEF3C7; color: #92400E; }
.status-confirmed  { background: #D1FAE5; color: #065F46; }
.status-processing { background: #EFF6FF; color: #1E40AF; }
.status-shipped    { background: #F0FFFE; color: #0E7490; }
.status-delivered  { background: #D1FAE5; color: #065F46; }
.status-cancelled  { background: #FEE2E2; color: #991B1B; }
.status-refunded   { background: #F5F3FF; color: #5B21B6; }
.status-paid       { background: #D1FAE5; color: #065F46; }
.status-failed     { background: #FEE2E2; color: #991B1B; }
.status-active     { background: #D1FAE5; color: #065F46; }
.status-inactive   { background: #F1F5F9; color: #64748B; }

/* -- Store Header Inner / Nav -------------------------------- */
.store-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}
.store-logo {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.store-badge-label {
  font-size: 11px;
  font-weight: 700;
  background: #EFF6FF;
  color: #2563EB;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .5px;
}
.store-header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}
.store-nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: color .15s;
}
.store-nav-link:hover { color: #2563EB; }
.store-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.store-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  transition: border-color .15s, color .15s;
}
.store-cart-btn:hover { border-color: #2563EB; color: #2563EB; }
.store-cart-btn .cart-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563EB;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}
.store-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #475569;
  margin-left: auto;
  padding: 4px 8px;
}
@media (max-width: 700px) {
  .store-header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #E2E8F0;
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(15,23,42,.08);
  }
  .store-header-nav.open { display: flex; }
  .store-hamburger { display: block; }
  .store-header-actions { gap: 8px; }
  .store-badge-label { display: none; }
}
