/* =========================================================
   EcomFront — utility.css
   Shared styles for: 404, wishlist, compare, order-confirmation, search-results
   ========================================================= */

/* ---------------------------------------------------------
   Page Hero (reused from cart pattern)
   --------------------------------------------------------- */
.ec-page-hero {
  background: linear-gradient(135deg, var(--ec-primary-light) 0%, #fff 100%);
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}
.ec-page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--ec-dark);
  margin-bottom: .5rem;
}
.ec-page-hero .breadcrumb { justify-content: center; margin: 0; }
.ec-page-hero .breadcrumb-item + .breadcrumb-item::before { color: var(--ec-muted); }
.ec-page-hero .breadcrumb-item a { color: var(--ec-primary); text-decoration: none; }
.ec-page-hero .breadcrumb-item.active { color: var(--ec-muted); }

/* ---------------------------------------------------------
   404 Page
   --------------------------------------------------------- */
.ec-404-wrap {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) 1rem;
}
.ec-404-number {
  font-size: clamp(5rem, 20vw, 12rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--ec-primary), var(--ec-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}
.ec-404-title {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--ec-dark);
  margin-bottom: .75rem;
}
.ec-404-lead {
  color: var(--ec-muted);
  max-width: 480px;
  margin: 0 auto 2rem;
}
.ec-404-search { max-width: 440px; width: 100%; margin: 0 auto 2rem; }
.ec-404-search .form-control { border-radius: var(--ec-radius-pill) 0 0 var(--ec-radius-pill); padding-left: 1.25rem; }
.ec-404-search .btn { border-radius: 0 var(--ec-radius-pill) var(--ec-radius-pill) 0; }
.ec-404-links { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---------------------------------------------------------
   Wishlist Page
   --------------------------------------------------------- */
.ec-wishlist-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--ec-radius-lg); box-shadow: var(--ec-shadow-sm); }
.ec-wishlist-table { width: 100%; min-width: 600px; border-collapse: collapse; background: var(--ec-white); }
.ec-wishlist-table thead th {
  padding: 1rem 1.25rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ec-muted);
  background: var(--ec-bg);
  border-bottom: 1.5px solid var(--ec-border);
  white-space: nowrap;
}
.ec-wishlist-table tbody td { padding: 1.125rem 1.25rem; border-bottom: 1px solid var(--ec-border); vertical-align: middle; }
.ec-wishlist-table tbody tr:last-child td { border-bottom: none; }
.ec-wishlist-table .ec-wl-img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--ec-radius); }
.ec-wishlist-table .ec-wl-name { font-weight: 600; color: var(--ec-dark); text-decoration: none; }
.ec-wishlist-table .ec-wl-name:hover { color: var(--ec-primary); }
.ec-wishlist-table .ec-wl-brand { font-size: .8rem; color: var(--ec-muted); }
.ec-wl-price { font-weight: 700; color: var(--ec-dark); }
.ec-wl-price del { color: var(--ec-muted); font-weight: 400; font-size: .85em; margin-left: .25rem; }
.ec-wl-stock-in  { color: var(--ec-success); font-size: .85rem; font-weight: 600; }
.ec-wl-stock-out { color: var(--ec-danger);  font-size: .85rem; font-weight: 600; }
.ec-wl-remove { background: none; border: none; color: var(--ec-muted); font-size: 1.1rem; cursor: pointer; padding: .375rem; border-radius: var(--ec-radius-sm); transition: color var(--ec-transition), background var(--ec-transition); }
.ec-wl-remove:hover { color: var(--ec-danger); background: #fef2f2; }
.ec-wl-empty { text-align: center; padding: 4rem 1rem; }
.ec-wl-empty i { font-size: 3.5rem; color: var(--ec-border); margin-bottom: 1rem; display: block; }

/* ---------------------------------------------------------
   Compare Page
   --------------------------------------------------------- */
.ec-compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ec-compare-table { min-width: 640px; width: 100%; border-collapse: collapse; }
.ec-compare-table th,
.ec-compare-table td { padding: .875rem 1.25rem; border: 1px solid var(--ec-border); vertical-align: top; }
.ec-compare-table th { background: var(--ec-bg); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ec-muted); width: 160px; white-space: nowrap; }
.ec-compare-table td { background: var(--ec-white); }
.ec-compare-head { text-align: center; padding: 1.5rem 1rem !important; }
.ec-compare-head img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--ec-radius); margin-bottom: .75rem; display: block; margin-left: auto; margin-right: auto; }
.ec-compare-head .ec-cmp-name { font-weight: 700; font-size: .95rem; color: var(--ec-dark); margin-bottom: .25rem; }
.ec-compare-head .ec-cmp-price { font-weight: 800; color: var(--ec-primary); font-size: 1.1rem; }
.ec-compare-check { color: var(--ec-success); font-size: 1.1rem; }
.ec-compare-cross { color: var(--ec-danger); font-size: 1.1rem; }
.ec-compare-remove { background: none; border: none; color: var(--ec-muted); cursor: pointer; font-size: 1rem; padding: .25rem .5rem; border-radius: var(--ec-radius-sm); }
.ec-compare-remove:hover { color: var(--ec-danger); background: #fef2f2; }
.ec-compare-star { color: var(--ec-warning); }

/* ---------------------------------------------------------
   Order Confirmation
   --------------------------------------------------------- */
.ec-confirm-hero {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5 50%, #a7f3d0);
  padding: clamp(3rem, 7vw, 5rem) 0;
  text-align: center;
}
.ec-confirm-icon {
  width: 80px; height: 80px;
  background: var(--ec-success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem; color: #fff;
  box-shadow: 0 0 0 12px rgba(16,185,129,.15);
}
.ec-confirm-title { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; color: var(--ec-dark); margin-bottom: .5rem; }
.ec-confirm-subtitle { color: var(--ec-muted); margin-bottom: 1.5rem; }
.ec-order-badge {
  display: inline-block;
  background: var(--ec-white);
  border: 2px solid var(--ec-success);
  color: var(--ec-success);
  font-weight: 700;
  font-size: 1.05rem;
  padding: .4rem 1.25rem;
  border-radius: var(--ec-radius-pill);
  margin-bottom: .5rem;
}
.ec-confirm-card {
  background: var(--ec-white);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: 1.5rem;
}
.ec-confirm-card-title { font-weight: 700; font-size: 1rem; color: var(--ec-dark); margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--ec-border); }
.ec-confirm-item { display: flex; gap: 1rem; align-items: center; padding: .75rem 0; border-bottom: 1px dashed var(--ec-border); }
.ec-confirm-item:last-child { border-bottom: none; }
.ec-confirm-item img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--ec-radius-sm); flex-shrink: 0; }
.ec-confirm-item-name { font-weight: 600; font-size: .9rem; color: var(--ec-dark); }
.ec-confirm-item-meta { font-size: .8rem; color: var(--ec-muted); }
.ec-confirm-item-price { font-weight: 700; color: var(--ec-dark); margin-left: auto; white-space: nowrap; }
.ec-confirm-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; font-size: .9rem; }
.ec-confirm-row.total { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--ec-border); margin-top: .5rem; padding-top: .75rem; }
.ec-confirm-step { display: flex; align-items: center; gap: 1rem; padding: .75rem; background: var(--ec-bg); border-radius: var(--ec-radius); }
.ec-confirm-step-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--ec-primary-light); color: var(--ec-primary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* ---------------------------------------------------------
   Search Results
   --------------------------------------------------------- */
.ec-search-hero { background: var(--ec-bg); padding: 2rem 0; border-bottom: 1px solid var(--ec-border); }
.ec-search-hero-form { max-width: 560px; }
.ec-search-hero-form .form-control { border-radius: var(--ec-radius-pill) 0 0 var(--ec-radius-pill); padding-left: 1.25rem; height: 50px; font-size: 1rem; }
.ec-search-hero-form .btn { border-radius: 0 var(--ec-radius-pill) var(--ec-radius-pill) 0; height: 50px; padding: 0 1.5rem; }
.ec-search-meta { font-size: .9rem; color: var(--ec-muted); margin-top: .75rem; }
.ec-search-meta strong { color: var(--ec-dark); }
.ec-no-results { text-align: center; padding: 4rem 1rem; }
.ec-no-results i { font-size: 4rem; color: var(--ec-border); margin-bottom: 1.25rem; display: block; }
.ec-no-results h3 { font-weight: 700; color: var(--ec-dark); margin-bottom: .5rem; }
.ec-search-suggestion { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; background: var(--ec-bg); border: 1px solid var(--ec-border); border-radius: var(--ec-radius-pill); font-size: .85rem; color: var(--ec-body); text-decoration: none; transition: background var(--ec-transition), border-color var(--ec-transition); cursor: pointer; }
.ec-search-suggestion:hover { background: var(--ec-primary-light); border-color: var(--ec-primary); color: var(--ec-primary); }

/* ---------------------------------------------------------
   Dark mode overrides
   --------------------------------------------------------- */
[data-ec-theme="dark"] .ec-wishlist-table thead th,
[data-ec-theme="dark"] .ec-compare-table th { background: #1f2937; }
[data-ec-theme="dark"] .ec-wishlist-table,
[data-ec-theme="dark"] .ec-wishlist-table tbody td,
[data-ec-theme="dark"] .ec-compare-table td { background: #111827; }
[data-ec-theme="dark"] .ec-confirm-card,
[data-ec-theme="dark"] .ec-404-search .form-control { background: #1f2937; border-color: #374151; color: #f9fafb; }
[data-ec-theme="dark"] .ec-confirm-step { background: #1f2937; }
[data-ec-theme="dark"] .ec-search-hero { background: #1f2937; border-color: #374151; }
[data-ec-theme="dark"] .ec-search-suggestion { background: #1f2937; border-color: #374151; color: #d1d5db; }
