/*
 * Storefront UI
 * Loaded only for customer-facing shop pages from header.php.
 */

:root {
  --store-navy: #102a43;
  --store-navy-deep: #071e31;
  --store-blue: #176b87;
  --store-cyan: #22a6b3;
  --store-mint: #e6f8f4;
  --store-coral: #ff6b4a;
  --store-yellow: #ffd166;
  --store-ink: #102a43;
  --store-muted: #627d98;
  --store-line: #d9e2ec;
  --store-canvas: #f4f8fb;
  --store-surface: #fff;
  --store-shadow: 0 20px 50px rgba(16, 42, 67, .1);
  --store-radius: 22px;
}

.shop-page,
.shop-flow,
.member-login-page,
.member-register-page {
  color: var(--store-ink);
}

.shop-page,
.shop-flow {
  padding: 32px 0 56px;
  background:
    radial-gradient(circle at 6% 0, rgba(34, 166, 179, .10), transparent 24rem),
    linear-gradient(180deg, #f7fbfd 0, #eef5f8 100%);
}

.shop-page .container,
.shop-flow .container,
.member-login-page .container,
.member-register-page .container {
  max-width: 1240px;
}

/* Shared shell and hero */
.shop-page .shop-shell,
.shop-flow .shop-flow-shell {
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  box-shadow: none;
}

.shop-page .shop-hero,
.shop-flow .shop-flow-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 220px;
  margin: 0 0 18px;
  padding: 42px 48px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 28px;
  background:
    linear-gradient(105deg, rgba(7, 30, 49, .98), rgba(16, 42, 67, .94) 58%, rgba(23, 107, 135, .9)),
    var(--store-navy);
  color: #fff;
  box-shadow: var(--store-shadow);
}

.shop-page .shop-hero::before,
.shop-flow .shop-flow-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -55px;
  bottom: -150px;
  width: 360px;
  height: 360px;
  border: 72px solid rgba(255, 209, 102, .12);
  border-radius: 50%;
}

.shop-page .shop-hero::after,
.shop-flow .shop-flow-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -70px;
  right: 23%;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(34, 166, 179, .18);
  filter: blur(2px);
}

.shop-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.shop-eyebrow,
.shop-flow-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #d9fbf4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.shop-page .shop-hero h3,
.shop-flow .shop-flow-hero h2,
.shop-flow .shop-flow-hero h3 {
  max-width: 760px;
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.025em;
}

.shop-page .shop-hero p,
.shop-flow .shop-flow-hero p {
  max-width: 650px;
  margin: 0;
  color: #c9d9e8;
  font-size: 15px;
  line-height: 1.8;
}

.shop-hero-actions,
.shop-flow-hero-actions,
.shop-action-row,
.shop-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.shop-hero-actions .btn,
.shop-flow-hero-actions .btn,
.shop-action-row .btn,
.shop-form-actions .btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
}

.shop-hero-actions .btn-success,
.shop-flow .btn-primary,
.shop-flow .btn-success,
.shop-page .btn-success {
  border-color: var(--store-coral);
  background: var(--store-coral);
  color: #fff;
}

.shop-hero-actions .btn-success:hover,
.shop-flow .btn-primary:hover,
.shop-flow .btn-success:hover,
.shop-page .btn-success:hover {
  border-color: #e95232;
  background: #e95232;
  color: #fff;
}

/* Storefront */
.shop-quick-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 22px;
}

.shop-quick-info-item {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 14px 17px;
  border: 1px solid var(--store-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 20px rgba(16, 42, 67, .045);
}

.shop-quick-info-item i {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--store-mint);
  color: var(--store-blue);
  font-size: 17px;
}

.shop-quick-info-item strong,
.shop-quick-info-item span { display: block; }
.shop-quick-info-item strong { color: var(--store-ink); font-size: 14px; }
.shop-quick-info-item span { margin-top: 2px; color: var(--store-muted); font-size: 12px; }

.shop-category-card,
.shop-panel,
.shop-card {
  border: 1px solid var(--store-line);
  border-radius: var(--store-radius);
  background: var(--store-surface);
  box-shadow: 0 14px 34px rgba(16, 42, 67, .07);
}

.shop-category-card {
  position: sticky;
  top: 96px;
  overflow: hidden;
}

.shop-category-head,
.shop-card-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--store-line);
  background: #f8fbfc;
}

.shop-category-title,
.shop-section-title,
.shop-card-title {
  margin: 0;
  color: var(--store-ink);
  font-size: 19px;
  font-weight: 800;
}

.shop-category-subtitle,
.shop-section-subtitle,
.shop-card-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--store-muted);
  font-size: 12px;
}

.shop-cat-list {
  margin: 0 !important;
  padding: 10px !important;
  list-style: none !important;
}

.shop-cat-list li + li { margin-top: 4px; }
.shop-cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  color: #334e68;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.shop-cat-list a:hover { transform: translateX(2px); }
.shop-cat-list a:hover,
.shop-cat-list a.active { background: var(--store-mint); color: var(--store-blue); }
.shop-cat-name { display: flex; align-items: center; min-width: 0; font-weight: 700; }
.shop-cat-name i { width: 19px; margin-right: 7px; color: var(--store-cyan); }
.shop-count-badge {
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #486581;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}
.shop-cat-list a.active .shop-count-badge { background: var(--store-blue); color: #fff; }

.shop-panel { overflow: hidden; }
.shop-toolbar {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 300px) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--store-line);
}
.shop-search { position: relative; min-width: 0; }
.shop-search i { position: absolute; top: 50%; left: 14px; color: #829ab1; transform: translateY(-50%); }
.shop-search .form-control {
  height: 44px;
  padding-left: 40px;
  border: 1px solid var(--store-line);
  border-radius: 12px;
  background: #f8fbfc;
  box-shadow: none;
}
.shop-search .form-control:focus { border-color: var(--store-cyan); box-shadow: 0 0 0 4px rgba(34,166,179,.12); }
.shop-toolbar-meta { display: flex; align-items: center; gap: 7px; color: var(--store-muted); font-size: 12px; white-space: nowrap; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
}

.shop-product-card {
  position: relative;
  display: flex;
  min-height: 100%;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--store-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 42, 67, .055);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.shop-product-card:hover { transform: translateY(-5px); border-color: #9fcbd2; box-shadow: 0 18px 38px rgba(16,42,67,.13); }
.product-thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: #f2f6f8; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.shop-product-card:hover .product-thumb img { transform: scale(1.045); }
.stock-pill {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(7, 30, 49, .84);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.product-body { display: flex; flex: 1; flex-direction: column; padding: 17px; }
.product-name { min-height: 44px; margin: 0 0 9px; font-size: 16px; font-weight: 800; line-height: 1.45; }
.product-name a { color: var(--store-ink); text-decoration: none; }
.product-name a:hover { color: var(--store-blue); }
.product-price { margin-bottom: 15px; color: var(--store-coral); font-size: 26px; font-weight: 800; line-height: 1; }
.product-price span { color: var(--store-muted); font-size: 12px; font-weight: 600; }
.product-actions { display: flex; gap: 8px; margin-top: auto; }
.product-actions input { width: 62px; height: 42px; border: 1px solid var(--store-line); border-radius: 11px; text-align: center; }
.product-actions .btn { flex: 1; min-height: 42px; border-radius: 11px; }
.product-detail-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-top: 11px; color: var(--store-muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.product-detail-link:hover { color: var(--store-blue); text-decoration: none; }
.shop-empty,
.shop-filter-empty { margin: 20px; padding: 42px 20px; border: 1px dashed #bcccdc; border-radius: 16px; background: #f8fbfc; color: var(--store-muted); text-align: center; }
.shop-filter-empty { display: none; }
.shop-empty i,
.shop-filter-empty i { display: block; margin-bottom: 10px; color: #9fb3c8; font-size: 40px; }

/* Transaction pages */
.shop-flow { --shop-primary: var(--store-blue); --shop-primary-dark: var(--store-navy); --shop-primary-soft: var(--store-mint); --shop-ink: var(--store-ink); --shop-muted: var(--store-muted); --shop-line: var(--store-line); --shop-soft: #f8fbfc; --shop-surface: #fff; }
.shop-card { overflow: hidden; margin-bottom: 18px; }
.shop-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-card-body { padding: 22px; }
.shop-flow .form-control,
.shop-flow select.form-control,
.shop-flow textarea.form-control {
  border-color: var(--store-line);
  border-radius: 12px;
  background-color: #fbfdfe;
  box-shadow: none;
}
.shop-flow .form-control:focus,
.shop-flow select.form-control:focus,
.shop-flow textarea.form-control:focus { border-color: var(--store-cyan) !important; box-shadow: 0 0 0 4px rgba(34,166,179,.12) !important; }
.shop-status-success { background: #ddf7ed; color: #087f5b; }
.shop-status-info { background: #e1f4f7; color: #176b87; }
.shop-status-warning { background: #fff2cc; color: #8d5c00; }
.shop-status-danger { background: #ffe3dc; color: #b9381e; }
.shop-total-box { border-color: #cce1e5; border-radius: 16px; background: #f0f8f9; }
.shop-grand-total,
.shop-detail-price,
.related-card-price { color: var(--store-coral); }
.shop-cart-qty-column { width: 150px; }
.shop-cart-total-column { width: 160px; }
.shop-cart-remove-column { width: 90px; }
.shop-cart-checkout-action { justify-content: flex-end; margin-top: 12px; }
.checkout-section-number,
.checkout-choice-icon { background: var(--store-mint); color: var(--store-blue); }
.checkout-choice-card:has(input:checked) { border-color: var(--store-cyan); background: #f0fbfa; box-shadow: 0 0 0 3px rgba(34,166,179,.1); }
.checkout-submit { background: linear-gradient(135deg, var(--store-coral), #ff8a5f); box-shadow: 0 12px 24px rgba(255,107,74,.22); }

/* Product detail */
.shop-detail-showcase { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr); gap: 36px; align-items: start; }
.shop-detail-gallery { min-width: 0; }
.shop-detail-main-image { position: relative; display: flex; overflow: hidden; aspect-ratio: 1/1; align-items: center; justify-content: center; border: 1px solid var(--store-line); border-radius: 20px; background: #f4f8fa; }
.shop-detail-main-image img { width: 100%; height: 100%; padding: 18px; object-fit: contain; transition: transform .3s ease; }
.shop-detail-main-image:hover img { transform: scale(1.025); }
.shop-detail-placeholder-square { display: flex; aspect-ratio: 1/1; align-items: center; justify-content: center; border-radius: 16px; background: #f4f8fa; color: #bcccdc; font-size: 3rem; }
.shop-detail-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; margin-top: 12px; }
.shop-detail-thumb { overflow: hidden; aspect-ratio: 1/1; padding: 4px; border: 2px solid var(--store-line); border-radius: 12px; background: #fff; cursor: pointer; }
.shop-detail-thumb img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.shop-detail-thumb.is-active,
.shop-detail-thumb:hover { border-color: var(--store-cyan); box-shadow: 0 0 0 3px rgba(34,166,179,.1); }
.shop-detail-info-panel { padding: 8px 0; }
.shop-detail-title { margin-bottom: 12px; color: var(--store-ink); font-size: clamp(25px, 3vw, 36px); font-weight: 800; line-height: 1.25; }
.shop-detail-rating { display: flex; align-items: center; gap: 5px; margin-bottom: 14px; color: #f5a524; }
.shop-detail-rating span { margin-left: 4px; color: var(--store-muted); font-size: 12px; }
.shop-detail-price { margin: 12px 0 20px; font-size: 35px; font-weight: 800; }
.shop-feature-badges { display: grid; gap: 8px; margin-bottom: 20px; padding: 15px; border: 1px solid #d7e8ea; border-radius: 14px; background: #f4fbfb; }
.shop-feature-badge { display: flex; align-items: center; gap: 8px; color: #334e68; font-size: 13px; }
.shop-feature-badge.success { color: #087f5b; }
.shop-feature-badge.delivery { color: var(--store-blue); }
.shop-feature-badge.is-out-of-stock { color: #d6452d; }
.shop-qty-selector { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.shop-qty-selector label { min-width: 56px; margin: 0; color: #334e68; font-weight: 700; }
.qty-input-group { display: flex; overflow: hidden; align-items: center; border: 1px solid var(--store-line); border-radius: 11px; background: #fff; }
.qty-btn { width: 42px; height: 42px; border: 0; background: #eef5f7; color: var(--store-navy); font-weight: 800; }
.qty-input-group input { width: 54px; border: 0; text-align: center; outline: 0; font-weight: 700; }
.shop-action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-action-buttons .btn { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 7px; border-radius: 12px; font-weight: 700; }
.shop-detail-section { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--store-line); }
.shop-detail-section h3 { margin: 0 0 16px; color: var(--store-ink); font-size: 21px; font-weight: 800; }
.shop-detail-description { padding: 18px; border-radius: 14px; background: #f7fafc; color: #486581; line-height: 1.85; }
.related-products-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.related-card { display: block; overflow: hidden; border: 1px solid var(--store-line); border-radius: 11px; background: #fff; color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.related-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16,42,67,.1); text-decoration: none; }
.related-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.related-card-body { padding: 9px 10px 10px; }
.related-card-title { overflow: hidden; margin-bottom: 4px; color: var(--store-ink); font-size: 12px; font-weight: 700; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.related-card-price { font-size: 13px; font-weight: 800; }

/* Member sign-in and registration */
.member-login-page,
.member-register-page {
  min-height: 68vh;
  padding: 60px 0 72px;
  background:
    radial-gradient(circle at 15% 12%, rgba(34,166,179,.15), transparent 25rem),
    radial-gradient(circle at 86% 82%, rgba(255,107,74,.1), transparent 22rem),
    #f4f8fb;
}
.member-login-shell,
.member-register-shell { max-width: 600px; margin: 0 auto; }
.member-login-card,
.member-register-card { overflow: hidden; border: 1px solid var(--store-line); border-radius: 26px; background: #fff; box-shadow: var(--store-shadow); }
.member-login-form-wrap,
.member-register-form-wrap { padding: 42px 48px 38px; }
.member-login-brandmark,
.member-register-brandmark { display: flex; width: 54px; height: 54px; margin: 0 auto 18px; align-items: center; justify-content: center; border-radius: 16px; background: var(--store-navy); color: #fff; font-size: 22px; box-shadow: 0 10px 22px rgba(16,42,67,.2); }
.member-login-title,
.member-register-title { margin-bottom: 23px; text-align: center; }
.member-login-title h2,
.member-register-title h2 { margin: 0 0 8px; color: var(--store-ink); font-size: 28px; font-weight: 800; }
.member-login-title p,
.member-register-title p { max-width: 460px; margin: auto; color: var(--store-muted); font-size: 13px; line-height: 1.7; }
.member-login-back { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 18px; color: var(--store-blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.member-login-form label,
.member-register-form label { margin-bottom: 7px; color: #334e68; font-size: 13px; font-weight: 700; }
.member-login-input-icon,
.member-register-input-icon { position: relative; }
.member-login-input-icon > i,
.member-register-input-icon > i { position: absolute; z-index: 2; top: 50%; left: 15px; color: #829ab1; transform: translateY(-50%); }
.member-login-input-icon .form-control,
.member-register-input-icon .form-control { height: 48px; padding-left: 43px; border: 1px solid var(--store-line); border-radius: 12px; background: #fbfdfe; box-shadow: none; }
.member-login-input-icon .form-control:focus,
.member-register-input-icon .form-control:focus { border-color: var(--store-cyan); box-shadow: 0 0 0 4px rgba(34,166,179,.12); }
.member-login-password-toggle,
.member-register-password-toggle { position: absolute; z-index: 2; top: 50%; right: 8px; padding: 6px 8px; border: 0; background: transparent; color: var(--store-blue); font-size: 11px; font-weight: 700; transform: translateY(-50%); }
.member-login-submit,
.member-register-submit { display: flex; width: 100%; min-height: 50px; margin-top: 8px; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 13px; background: linear-gradient(135deg, var(--store-coral), #ff8a5f); color: #fff; font-weight: 800; box-shadow: 0 12px 24px rgba(255,107,74,.22); }
.member-login-register,
.member-register-login { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--store-line); text-align: center; }
.member-login-register p,
.member-register-login p { margin: 0 0 5px; color: var(--store-muted); font-size: 12px; }
.member-login-register a,
.member-register-login a { color: var(--store-blue); font-weight: 800; text-decoration: none; }
.member-login-secure-note { margin-top: 18px; color: #829ab1; font-size: 11px; text-align: center; }
.member-register-steps { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 0 22px; color: #829ab1; font-size: 11px; }
.member-register-steps span { padding: 5px 9px; border-radius: 999px; background: #eef5f7; }
.member-register-hint,
.member-register-match { margin: 7px 0 0; color: var(--store-muted); font-size: 11px; }
.member-register-strength { overflow: hidden; height: 5px; margin-top: 8px; border-radius: 99px; background: #e4edf2; }
.member-register-strength span { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .2s ease, background .2s ease; }

/* Accessible focus and reduced motion */
.shop-page a:focus-visible,
.shop-flow a:focus-visible,
.shop-page button:focus-visible,
.shop-flow button:focus-visible,
.member-login-page button:focus-visible,
.member-register-page button:focus-visible { outline: 3px solid rgba(34,166,179,.34); outline-offset: 3px; }

@media (max-width: 1199px) {
  .shop-toolbar { grid-template-columns: 1fr minmax(210px, 280px); }
  .shop-toolbar-meta { grid-column: 1/-1; }
}

@media (max-width: 991px) {
  .shop-page .shop-hero,
  .shop-flow .shop-flow-hero,
  .shop-hero-content { align-items: flex-start; flex-direction: column; }
  .shop-hero-actions,
  .shop-flow-hero-actions { justify-content: flex-start; }
  .shop-category-card { position: static; margin-bottom: 18px; }
  .shop-detail-showcase { grid-template-columns: 1fr; }
  .related-products-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .shop-page,
  .shop-flow { padding: 20px 0 38px; }
  .shop-page .shop-hero,
  .shop-flow .shop-flow-hero { min-height: 0; padding: 28px 24px; border-radius: 20px; }
  .shop-quick-info { grid-template-columns: 1fr; }
  .shop-toolbar { grid-template-columns: 1fr; }
  .shop-toolbar-meta { grid-column: auto; }
  .shop-grid { grid-template-columns: 1fr; padding: 14px; }
  .product-thumb { aspect-ratio: 16/11; }
  .shop-card-header,
  .shop-card-body { padding: 17px; }
  .member-login-page,
  .member-register-page { padding: 30px 0 44px; }
  .member-login-form-wrap,
  .member-register-form-wrap { padding: 32px 22px 28px; }
  .member-login-card,
  .member-register-card { border-radius: 20px; }
}

@media (max-width: 575px) {
  .shop-action-buttons,
  .related-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-hero-actions,
  .shop-flow-hero-actions,
  .shop-action-row,
  .shop-form-actions { width: 100%; }
  .shop-hero-actions .btn,
  .shop-flow-hero-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .shop-product-card,
  .product-thumb img,
  .related-card,
  .shop-detail-main-image img { transition: none; }
}
