/* ═══════════════════════════════════════════════════════════════════════════
   Amazon Product Widget — Frontend Styles
   Design: deep navy + amber accent, clean sans-serif, confident spacing
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --apw-navy:      #0f2744;
  --apw-navy-mid:  #1a3a63;
  --apw-amber:     #f5a623;
  --apw-amber-dk:  #d4891a;
  --apw-green:     #1a8a47;
  --apw-green-lt:  #eafaf1;
  --apw-red:       #c0392b;
  --apw-surface:   #ffffff;
  --apw-bg:        #f8f9fc;
  --apw-border:    #e3e8f0;
  --apw-muted:     #6b7a99;
  --apw-text:      #1a1f36;
  --apw-radius:    10px;
  --apw-shadow:    0 2px 16px rgba(15,39,68,.09);
  --apw-shadow-hv: 0 8px 32px rgba(15,39,68,.16);
  --apw-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --apw-transition: .22s cubic-bezier(.4,0,.2,1);
}

.apw-wrapper * { box-sizing: border-box; }


/* ═══════════════════════════════════════════════════════════════════════════
   BOX TEMPLATE
   ═══════════════════════════════════════════════════════════════════════════ */

.apw-product-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  border: 1.5px solid var(--apw-border);
  border-radius: var(--apw-radius);
  padding: 22px;
  margin: 28px 0;
  background: var(--apw-surface);
  box-shadow: var(--apw-shadow);
  font-family: var(--apw-font);
  transition: box-shadow var(--apw-transition), transform var(--apw-transition);
}
.apw-product-box:hover {
  box-shadow: var(--apw-shadow-hv);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .apw-product-box { flex-direction: column; gap: 16px; }
}

.apw-product-image { flex: 0 0 170px; text-align: center; }
.apw-product-image a { display: inline-block; }
.apw-product-image img {
  max-width: 170px; max-height: 170px;
  width: auto; height: auto; object-fit: contain;
  transition: transform var(--apw-transition);
}
.apw-product-image a:hover img { transform: scale(1.06); }

.apw-product-info { flex: 1; min-width: 0; }

.apw-product-brand {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--apw-muted); text-transform: uppercase; margin: 0 0 6px;
}
.apw-product-title {
  font-size: 16px; font-weight: 700; line-height: 1.45;
  color: var(--apw-text); margin: 0 0 14px;
}
.apw-product-title a { color: inherit; text-decoration: none; }
.apw-product-title a:hover { color: var(--apw-navy-mid); text-decoration: underline; }

.apw-product-features {
  margin: 0 0 16px; padding-left: 0; list-style: none;
  font-size: 13px; color: #444; line-height: 1.65;
}
.apw-product-features li {
  padding: 3px 0 3px 18px; position: relative;
}
.apw-product-features li::before {
  content: '✓'; position: absolute; left: 0;
  color: var(--apw-green); font-weight: 700; font-size: 11px; top: 5px;
}

.apw-product-footer {}

.apw-product-price-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.apw-product-price { font-size: 24px; font-weight: 800; color: var(--apw-red); }

/* Prime badge */
.apw-prime-badge svg { width: 52px; height: 15px; vertical-align: middle; }

.apw-availability { font-size: 12px; color: var(--apw-green); font-weight: 600; margin: 0 0 12px; }

/* Main CTA button */
.apw-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--apw-amber) 0%, var(--apw-amber-dk) 100%);
  border: none; border-radius: 7px;
  color: #fff !important; font-family: var(--apw-font);
  font-size: 14px; font-weight: 700;
  padding: 11px 22px; text-decoration: none !important;
  cursor: pointer; box-shadow: 0 2px 8px rgba(245,166,35,.35);
  transition: background var(--apw-transition), transform var(--apw-transition), box-shadow var(--apw-transition);
}
.apw-btn:hover {
  background: linear-gradient(135deg, #f9b84a 0%, var(--apw-amber) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245,166,35,.45);
}
.apw-btn:active { transform: translateY(0); }
.apw-btn-sm { padding: 7px 14px; font-size: 13px; }

.apw-disclaimer { font-size: 11px; color: #bbb; margin-top: 10px; }
.apw-error { color: var(--apw-red); font-style: italic; font-size: 13px; }


/* ═══════════════════════════════════════════════════════════════════════════
   LIST TEMPLATE
   ═══════════════════════════════════════════════════════════════════════════ */

.apw-product-list-item {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid var(--apw-border); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--apw-surface); box-shadow: var(--apw-shadow);
  font-family: var(--apw-font);
  transition: box-shadow var(--apw-transition), transform var(--apw-transition);
}
.apw-product-list-item:hover { box-shadow: var(--apw-shadow-hv); transform: translateY(-1px); }

.apw-list-image { flex: 0 0 60px; }
.apw-list-image img { width: 60px; height: 60px; object-fit: contain; transition: transform var(--apw-transition); }
.apw-product-list-item:hover .apw-list-image img { transform: scale(1.08); }

.apw-list-body { flex: 1; min-width: 0; }
.apw-list-body .apw-product-title { font-size: 14px; margin: 4px 0 0; font-weight: 600; }

.apw-list-action { text-align: right; min-width: 120px; flex-shrink: 0; }
.apw-list-action .apw-product-price { display: block; margin-bottom: 6px; font-size: 17px; }

.apw-prime-badge-small {
  display: inline-block; background: #00A8E0; color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 3px; margin-bottom: 4px;
}

/* Button template */
.apw-product-button { display: inline-flex; align-items: center; gap: 10px; margin: 6px 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   SPOTLIGHT TEMPLATE
   Inline keyword cards — sits inside content text naturally
   ═══════════════════════════════════════════════════════════════════════════ */

.apw-spotlight-wrap {
  margin: 28px 0;
  font-family: var(--apw-font);
}

.apw-spotlight-heading {
  font-size: 13px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--apw-muted);
  margin: 0 0 14px; padding-left: 4px;
}

.apw-spotlight-grid {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}
@media (max-width: 680px) {
  .apw-spotlight-grid { flex-direction: column; }
}

/* Individual card */
.apw-spotlight-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  border: 1.5px solid var(--apw-border);
  border-radius: var(--apw-radius);
  background: var(--apw-surface);
  box-shadow: var(--apw-shadow);
  text-decoration: none !important;
  color: var(--apw-text);
  overflow: hidden;
  transition: box-shadow var(--apw-transition), transform var(--apw-transition), border-color var(--apw-transition);
}
.apw-spotlight-card:hover {
  box-shadow: var(--apw-shadow-hv);
  transform: translateY(-4px);
  border-color: var(--apw-amber);
  text-decoration: none !important;
}

/* Rank badge */
.apw-spotlight-rank {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--apw-navy); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 22px;
  text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Image area */
.apw-spotlight-img-wrap {
  width: 100%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--apw-bg);
  padding: 16px;
  overflow: hidden;
}
.apw-spotlight-img-wrap img {
  max-width: 100%; max-height: 110px;
  object-fit: contain;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.apw-spotlight-card:hover .apw-spotlight-img-wrap img {
  transform: scale(1.12);
}
.apw-spotlight-no-img { font-size: 40px; }

/* Text body */
.apw-spotlight-body {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 12px 14px;
  width: 100%;
}

.apw-spotlight-brand {
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--apw-muted);
}

.apw-spotlight-title {
  font-size: 12.5px; font-weight: 600; color: var(--apw-text);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.apw-spotlight-price {
  font-size: 15px; font-weight: 800; color: var(--apw-red); margin-top: 2px;
}

/* Bottom CTA stripe */
.apw-spotlight-cta {
  display: block;
  margin-top: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: var(--apw-navy);
  padding: 6px 10px;
  background: var(--apw-bg);
  border-top: 1px solid var(--apw-border);
  border-radius: 0 0 4px 4px;
  text-align: center;
  transition: background var(--apw-transition), color var(--apw-transition);
  width: calc(100% + 0px);
  margin-left: -12px; margin-right: -12px; margin-bottom: -14px;
  width: calc(100% + 24px);
}
.apw-spotlight-card:hover .apw-spotlight-cta {
  background: var(--apw-amber); color: #fff;
}


/* ═══════════════════════════════════════════════════════════════════════════
   COMPARISON TABLE
   ═══════════════════════════════════════════════════════════════════════════ */

.apw-compare-outer {
  margin: 32px 0;
  font-family: var(--apw-font);
}

.apw-compare-heading {
  font-size: 20px; font-weight: 800;
  color: var(--apw-navy);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--apw-amber);
  display: inline-block;
}

/* Horizontal scroll on mobile */
.apw-compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.apw-compare-table {
  width: 100%; min-width: 480px;
  border-collapse: collapse;
  background: var(--apw-surface);
  border-radius: var(--apw-radius);
  box-shadow: var(--apw-shadow);
  overflow: hidden;
  /* border-radius on tables needs overflow:hidden on container */
}

/* Header product columns */
.apw-compare-header-row {
  background: linear-gradient(135deg, var(--apw-navy) 0%, var(--apw-navy-mid) 100%);
}
.apw-compare-header-row th { border: none; padding: 0; }

.apw-compare-label-col {
  width: 130px; min-width: 110px;
  background: var(--apw-navy) !important;
}

.apw-compare-product-col {
  vertical-align: top;
  padding: 0 !important;
  border-left: 1px solid rgba(255,255,255,.1);
}

.apw-compare-product-head {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 14px 16px; gap: 8px;
  text-align: center;
}

.apw-compare-img-link { display: inline-block; }
.apw-compare-thumb {
  width: 90px; height: 90px; object-fit: contain;
  background: rgba(255,255,255,.08); border-radius: 8px; padding: 6px;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.apw-compare-img-link:hover .apw-compare-thumb { transform: scale(1.12) rotate(-1deg); }

.apw-compare-head-brand {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,.55);
}
.apw-compare-head-title {
  font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.92);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.apw-compare-head-title a { color: inherit; text-decoration: none; }
.apw-compare-head-title a:hover { text-decoration: underline; }

/* Body rows */
.apw-compare-row { transition: background var(--apw-transition); }
.apw-compare-row:nth-child(even) { background: var(--apw-bg); }
.apw-compare-row:hover { background: #eef3fd; }

.apw-compare-label {
  padding: 11px 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  color: var(--apw-muted); text-transform: uppercase;
  border-right: 2px solid var(--apw-border);
  white-space: nowrap;
  vertical-align: middle;
  background: #f3f6fb;
}

.apw-compare-cell {
  padding: 11px 14px;
  font-size: 13px; color: var(--apw-text);
  border-left: 1px solid var(--apw-border);
  vertical-align: middle; text-align: center;
  line-height: 1.5;
}

/* Price cell */
.apw-compare-row--price .apw-compare-cell { vertical-align: middle; }
.apw-compare-price { font-size: 17px; font-weight: 800; color: var(--apw-red); }
.apw-best-price { color: var(--apw-green) !important; }
.apw-best-badge {
  display: inline-block; background: var(--apw-green);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; vertical-align: middle;
  margin-left: 4px;
}

/* Stars */
.apw-stars { font-size: 16px; white-space: nowrap; }
.apw-star--full  { color: #f5a623; }
.apw-star--half  { color: #f5a623; opacity: .55; }
.apw-star--empty { color: #ddd; }
.apw-stars small { font-size: 11px; color: var(--apw-muted); margin-left: 2px; }
.apw-review-count { font-size: 11px; color: var(--apw-muted); }

/* Prime */
.apw-compare-prime {
  display: inline-block; background: #00A8E0; color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 4px;
}
.apw-compare-no-prime { color: var(--apw-muted); }

/* Feature rows */
.apw-compare-row--feature .apw-compare-cell { text-align: left; font-size: 12.5px; }

/* CTA row */
.apw-compare-cta-row { background: #f0f4fb !important; }
.apw-compare-cta-row:hover { background: #e8eef9 !important; }
.apw-compare-cta-cell { padding: 14px 12px !important; }

.apw-compare-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 10px 16px;
  font-size: 13px; width: 100%;
  justify-content: center;
}
.apw-compare-btn--best {
  background: linear-gradient(135deg, #1cb75a 0%, #12924a 100%) !important;
  box-shadow: 0 2px 10px rgba(26,138,71,.35) !important;
}
.apw-compare-btn--best:hover {
  background: linear-gradient(135deg, #21d468 0%, #18aa58 100%) !important;
  box-shadow: 0 4px 16px rgba(26,138,71,.45) !important;
}
.apw-btn-price { font-size: 13px; font-weight: 800; opacity: .95; }
