/* ============================================================
   Store front — shared design system layer
   Category / Search / Wishlist / My Orders / Order Track pages
   + consistency overrides for cards, buttons, states
   ============================================================ */

:root {
  --st-primary: #000;
  --st-text: #212121;
  --st-muted: #6b6b6b;
  --st-border: rgba(0, 0, 0, 0.1);
  --st-green: #388e3c;
  --st-red: #d32f2f;
  --st-blue: #1e88e5;
  --st-bg: #f8f8f8;
  --st-radius: 8px;
  --st-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ---------------- Page shell ---------------- */

.st-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.st-page-head {
  margin-bottom: 16px;
}

.st-breadcrumb {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.st-breadcrumb a {
  color: #4a4a4a;
  text-decoration: none;
}

.st-breadcrumb a:hover {
  color: #000;
  text-decoration: underline;
}

.st-page-title {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  margin: 0 0 4px;
}

.st-page-sub {
  color: #777;
  font-size: 14px;
  margin: 0;
}

/* ---------------- Product grid reuse ---------------- */
.st-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.st-grid .product-card {
  height: auto;
}

@media (min-width: 640px) {
  .st-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 992px) {
  .st-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
  .st-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------------- States ---------------- */
.st-empty {
  text-align: center;
  padding: 64px 16px;
}

.st-empty .st-empty-icon {
  font-size: 44px;
  color: #bbb;
  margin-bottom: 12px;
}

.st-empty h2 {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}

.st-empty p {
  color: #777;
  margin-bottom: 18px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.st-empty-btn {
  display: inline-block;
  background: #000;
  color: #fff;
  border-radius: 6px;
  padding: 10px 26px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid #000;
}

.st-empty-btn:hover {
  background: #262626;
  color: #fff;
}

.st-btn {
  display: inline-block;
  background: #000;
  color: #fff;
  border-radius: 6px;
  padding: 10px 26px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid #000;
}

.st-btn:hover {
  background: #262626;
  color: #fff;
}

/* ---------------- Category index cards ---------------- */
.st-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.st-cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 18px 16px;
  background: #fff;
  box-shadow: var(--st-shadow);
  text-decoration: none;
  color: #111;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.st-cat-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  color: #111;
}

.st-cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #000;
}

.st-cat-name {
  font-size: 16px;
  font-weight: 700;
}

.st-cat-count {
  font-size: 13px;
  color: #777;
}

.st-cat-arrow {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #bbb;
  font-size: 14px;
}

.st-cat-card:hover .st-cat-arrow {
  color: #000;
}

@media (min-width: 640px) {
  .st-cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 992px) {
  .st-cat-grid { grid-template-columns: repeat(4, 1fr); }
}

.st-error {
  text-align: center;
  padding: 60px 16px;
}

.st-error h2 {
  font-size: 20px;
  font-weight: 700;
}

.st-error p {
  color: #777;
  margin-bottom: 16px;
}

.st-error-retry {
  border: 1px solid #000;
  background: #fff;
  color: #000;
  border-radius: 6px;
  padding: 8px 22px;
  font-weight: 600;
  cursor: pointer;
}

.st-error-retry:hover {
  background: #000;
  color: #fff;
}

/* ---------------- Skeleton loading ---------------- */
.st-skeleton {
  background: #eee;
  border-radius: var(--st-radius);
  animation: st-pulse 1.2s ease-in-out infinite;
}

@keyframes st-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.st-skeleton-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  overflow: hidden;
  background: #fff;
}

.st-skeleton-media {
  width: 100%;
  aspect-ratio: 4 / 5;
}

.st-skeleton-line {
  height: 13px;
  margin: 10px 12px 0;
}

.st-skeleton-line.short {
  width: 55%;
}

.st-skeleton-line.button {
  height: 34px;
  margin: 14px 12px 12px;
  border-radius: 6px;
}

/* ---------------- Status badges ---------------- */
.st-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.st-badge-pending { background: #fff3cd; color: #856404; }
.st-badge-confirmed { background: #e2e3f3; color: #4338ca; }
.st-badge-packed { background: #cfe8ff; color: #0b5aa8; }
.st-badge-shipped { background: #d7f0ff; color: #0369a1; }
.st-badge-delivered { background: #d9f2dc; color: #1b7a2d; }
.st-badge-cancelled { background: #fee2e2; color: #b91c1c; }
.st-badge-returned { background: #fde8d9; color: #b45309; }
.st-badge-paid { background: #d9f2dc; color: #1b7a2d; }
.st-badge-unpaid { background: #fef3c7; color: #92400e; }
.st-badge-failed { background: #fee2e2; color: #b91c1c; }
.st-badge-refunded { background: #e9e9e9; color: #555; }

/* ---------------- My Orders ---------------- */
.st-orders {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.st-order-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--st-shadow);
}

.st-order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--st-border);
  background: #fafafa;
}

.st-order-num {
  font-weight: 700;
  font-size: 14px;
  color: #111;
}

.st-order-meta {
  font-size: 12.5px;
  color: #666;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.st-order-items {
  padding: 6px 16px;
}

.st-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  font-size: 14px;
}

.st-order-item:last-child {
  border-bottom: 0;
}

.st-order-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f2f2f2;
  flex-shrink: 0;
}

.st-order-item-title {
  flex: 1;
  color: #333;
  line-height: 1.35;
}

.st-order-item-qty {
  color: #777;
  font-size: 13px;
  padding-right: 16px;
}

.st-order-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--st-border);
}

.st-order-total {
  font-weight: 700;
  font-size: 15px;
  color: #111;
}

.st-order-view {
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.st-order-view:hover {
  background: #262626;
  color: #fff;
}

/* ---------------- Order Track ---------------- */
.st-track-form {
  display: flex;
  gap: 0;
  max-width: 460px;
  border: 1px solid #000;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  margin: 10px 0 24px;
}

.st-track-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
}

.st-track-form button {
  border: 0;
  background: #000;
  color: #fff;
  padding: 0 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.st-track-form button:hover {
  background: #262626;
}

.st-track-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  background: #fff;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--st-shadow);
}

.st-track-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.st-track-head h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.st-track-line {
  color: #777;
  font-size: 13.5px;
  margin-bottom: 14px;
}

.st-timeline {
  display: flex;
  align-items: flex-start;
  margin: 8px 0 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.st-step {
  flex: 1;
  min-width: 96px;
  text-align: center;
  position: relative;
}

.st-step-dot {
  width: 18px;
  height: 18px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #ccc;
  position: relative;
  z-index: 1;
}

.st-step.done .st-step-dot {
  background: var(--st-green);
  border-color: var(--st-green);
}

.st-step.active .st-step-dot {
  background: #fff;
  border-color: var(--st-green);
  box-shadow: 0 0 0 3px rgba(56, 142, 60, 0.18);
}

.st-step.cancel .st-step-dot {
  background: var(--st-red);
  border-color: var(--st-red);
}

.st-step-name {
  font-size: 12px;
  font-weight: 700;
  color: #999;
}

.st-step.done .st-step-name, .st-step.active .st-step-name {
  color: #222;
}

.st-step.cancel .st-step-name {
  color: var(--st-red);
}

.st-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(50% + 12px);
  right: calc(-50% + 12px);
  height: 3px;
  background: #ddd;
}

.st-step:not(:last-child).done::after {
  background: var(--st-green);
}

.st-track-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 24px;
  font-size: 13.5px;
  color: #444;
  margin-top: 8px;
}

.st-track-fields b {
  color: #111;
}

.st-track-items {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  overflow: hidden;
}

.st-track-items table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.st-track-items th,
.st-track-items td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--st-border);
}

.st-track-items th {
  background: #fafafa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #666;
}

.st-track-items tr:last-child td {
  border-bottom: 0;
}

/* ---------------- Quantities / misc ---------------- */
.st-muted {
  color: #777;
}

/* ---------------- Product page CTA row ---------------- */
.pd-breadcrumb {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.pd-breadcrumb a {
  color: #4a4a4a;
  text-decoration: none;
}

.pd-breadcrumb a:hover {
  color: #000;
  text-decoration: underline;
}

.pd-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 4px;
  max-width: 560px;
}

.pd-buy-now,
.pd-cta-row .card-atc,
.pd-now-add {
  border-radius: 6px;
  padding: 13px 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #000;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  width: 100%;
}

.pd-buy-now {
  background: #000;
  color: #fff;
}

.pd-buy-now:hover {
  background: #262626;
}

.pd-cta-row .card-atc,
.pd-now-add {
  background: #fff;
  color: #000;
}

.pd-cta-row .card-atc:hover,
.pd-now-add:hover {
  background: #f3f3f3;
}

.pd-buy-now:disabled,
.pd-cta-row .card-atc:disabled,
.pd-now-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pd-cta-row .card-atc.is-added {
  background: #388e3c;
  border-color: #388e3c;
  color: #fff;
}

.pd-out-stock {
  text-align: center;
  padding: 12px;
  border: 1px solid var(--st-border);
  border-radius: 6px;
  background: #fafafa;
  color: #b91c1c;
  font-weight: 600;
  font-size: 14px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
  .st-page { padding: 14px 12px 32px; }
  .st-page-title { font-size: 20px; }
  .st-track-card { padding: 14px 12px; }
}

/* hide the old placeholder page tags */
.api-public-products-guard { display: none; }

/* ---------------- Footer strips ---------------- */
.footer-bottom,
.footer-strip {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 16px;
  text-align: center;
  background: #000;
  color: #aaa;
  font-size: 12.5px;
}

.home-footer-col {
  color: inherit;
  text-decoration: none;
}

.footer-style-2,
.footer-style-9,
.footer-style-17 {
  color: inherit;
  text-decoration: none;
}

.footer-style-2:hover,
.footer-style-9:hover,
.footer-style-17:hover,
.home-footer-col:hover h6 {
  color: #000;
}

/* ---------------- Minimum screen ---------------- */

/* ---------------- Accessibility ---------------- */
:focus-visible {
  outline: 3px solid #1e4ae0;
  outline-offset: 2px;
}

.site-header :focus-visible {
  outline-color: #ffd54d;
  outline-offset: 2px;
}

.card-atc:focus-visible,
.st-empty-btn:focus-visible,
.st-btn:focus-visible,
.st-order-view:focus-visible {
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .st-skeleton,
  .st-cat-card,
  .co-checkmark-circle,
  .co-checkmark-check {
    animation: none;
  }
}