/* =============================================================
   AEDS Frontend — Shopify-style Single Product Enhancements
   ============================================================= */

:root {
  --aeds-radius:  10px;
  --aeds-orange:  #ff6a00;
  --aeds-green:   #008060;
  --aeds-text:    #1a1a1a;
  --aeds-muted:   #6b7280;
  --aeds-border:  #e5e7eb;
  --aeds-bg:      #f9fafb;
  --aeds-surface: #ffffff;
  --aeds-shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
}

/* ── Trust bar ──────────────────────────────────────────── */
.aeds-trust-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--aeds-bg);
  border: 1px solid var(--aeds-border);
  border-radius: var(--aeds-radius);
  margin: 16px 0;
}
.aeds-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  font-size: 11px;
  color: var(--aeds-muted);
  text-align: center;
  line-height: 1.3;
}
.aeds-trust-icon {
  width: 20px;
  height: 20px;
  stroke: var(--aeds-orange);
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .aeds-trust-bar  { flex-wrap: wrap; }
  .aeds-trust-item { min-width: 40%; }
}

/* ── Shipping panel ─────────────────────────────────────── */
.aeds-ship-panel {
  border: 1px solid var(--aeds-border);
  border-radius: var(--aeds-radius);
  overflow: hidden;
  margin: 14px 0;
  background: var(--aeds-surface);
  box-shadow: var(--aeds-shadow);
}

/* Country selector row */
.aeds-ship-country-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f8f9fb;
  border-bottom: 1px solid var(--aeds-border);
}
.aeds-ship-country-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--aeds-text);
  white-space: nowrap;
  cursor: default;
}
.aeds-ship-country-label svg {
  stroke: var(--aeds-orange);
  flex-shrink: 0;
}
/* Searchable country dropdown */
.aeds-country-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 280px;
}
.aeds-country-input {
  width: 100%;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  border: 1px solid var(--aeds-border);
  border-radius: 6px;
  background: #fff;
  color: var(--aeds-text);
  cursor: text;
  transition: border-color .15s;
  box-sizing: border-box;
}
.aeds-country-input:focus {
  outline: none;
  border-color: var(--aeds-orange);
  box-shadow: 0 0 0 2px rgba(255,106,0,.15);
}
.aeds-dd-arrow {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--aeds-muted);
  pointer-events: none;
  transition: transform .2s;
}
.aeds-dd-open .aeds-dd-arrow { transform: translateY(-50%) rotate(180deg); }
.aeds-country-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--aeds-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 9999;
  -webkit-overflow-scrolling: touch;
}
.aeds-dd-open .aeds-country-list { display: block; }
.aeds-country-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--aeds-text);
  cursor: pointer;
  transition: background .1s;
  outline: none;
}
.aeds-country-item:hover,
.aeds-country-item:focus   { background: #fff5f0; }
.aeds-country-item.aeds-country-active {
  color: var(--aeds-orange);
  font-weight: 600;
}
.aeds-country-item strong  { color: var(--aeds-orange); }
@media (max-width: 480px) {
  .aeds-country-wrap { max-width: 100%; }
}

/* Toggle header */
.aeds-ship-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: var(--aeds-surface);
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.aeds-ship-toggle:hover,
.aeds-ship-toggle[aria-expanded="true"] { background: #f8f9fb; }

.aeds-ship-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--aeds-text);
}
.aeds-ship-icon {
  width: 20px; height: 20px;
  stroke: var(--aeds-orange);
  flex-shrink: 0;
}

/* Spinner (rotating ring) */
.aeds-ship-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--aeds-border);
  border-top-color: var(--aeds-orange);
  border-radius: 50%;
  animation: aeds-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes aeds-spin { to { transform: rotate(360deg); } }

/* Chevron */
.aeds-chevron {
  width: 16px; height: 16px;
  stroke: var(--aeds-muted);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.aeds-ship-toggle[aria-expanded="true"] .aeds-chevron { transform: rotate(180deg); }

/* Body */
.aeds-ship-body {
  border-top: 1px solid var(--aeds-border);
}
.aeds-ship-body[hidden] { display: none; }
.aeds-ship-body-inner { padding: 4px 0; }

/* Rows */
.aeds-ship-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 9px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}
.aeds-ship-row:last-child   { border-bottom: 0; }
.aeds-ship-row-even         { background: #fafbfc; }
.aeds-ship-key {
  color: var(--aeds-muted);
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center;
}
.aeds-ship-val {
  color: var(--aeds-text);
  font-weight: 600; font-size: 13px;
  display: flex; align-items: center;
}
.aeds-yes { color: var(--aeds-green); font-weight: 600; }
.aeds-no  { color: #dc2626; font-weight: 600; }

/* Empty / error */
.aeds-ship-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--aeds-muted);
  text-align: center;
}

/* Skeleton loader */
.aeds-ship-skeleton { padding: 12px 16px; }
.aeds-sk-line {
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);
  background-size: 200% 100%;
  animation: aeds-shimmer 1.4s infinite;
  margin-bottom: 10px;
}
.aeds-sk-line.short { width: 55%; }
.aeds-sk-line:last-child { margin-bottom: 0; }
@keyframes aeds-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Loading state: dim body slightly */
.aeds-ship-loading .aeds-ship-body { opacity: .6; transition: opacity .2s; }

@media (max-width: 480px) {
  .aeds-ship-row { grid-template-columns: 1fr; gap: 2px; }
  .aeds-ship-key { font-size: 11px; }
  .aeds-ship-to-select { max-width: 100%; }
}

/* ── Guarantee row ──────────────────────────────────────── */
.aeds-guarantee-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--aeds-surface);
  border: 1px solid var(--aeds-border);
  border-radius: var(--aeds-radius);
  margin: 12px 0 16px;
}
.aeds-gr-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  font-size: 12px;
  color: var(--aeds-muted);
  font-weight: 500;
  text-align: center;
  flex-direction: column;
  padding: 0 6px;
}
.aeds-gr-item svg {
  width: 18px; height: 18px;
  fill: var(--aeds-orange);
  opacity: .9;
  flex-shrink: 0;
}
.aeds-gr-sep {
  width: 1px; height: 32px;
  background: var(--aeds-border);
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .aeds-guarantee-row { flex-wrap: wrap; gap: 10px; }
  .aeds-gr-sep        { display: none; }
  .aeds-gr-item       { min-width: 40%; flex-direction: row; }
}

/* ── Stock badge ────────────────────────────────────────── */
.aeds-stock-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.aeds-stock-low  { background: #fff3cd; color: #92400e; border: 1px solid #fbbf24; }
.aeds-stock-med  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.aeds-stock-out  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Shipping compare (cheapest vs fastest) ─────────────── */
.aeds-ship-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.aeds-cmp-card {
  border-right: 1px solid var(--aeds-border);
}
.aeds-cmp-card:last-child { border-right: 0; }
.aeds-cmp-label {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.aeds-cmp-cheap { color: var(--aeds-green); }
.aeds-cmp-fast  { color: var(--aeds-orange); }
@media (max-width: 560px) {
  .aeds-ship-compare { grid-template-columns: 1fr; }
  .aeds-cmp-card { border-right: 0; border-bottom: 1px solid var(--aeds-border); }
  .aeds-cmp-card:last-child { border-bottom: 0; }
}

/* ── Syria proxy notice ─────────────────────────────────── */
.aeds-syria-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 16px 4px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 12px;
  color: #78350f;
  line-height: 1.5;
}
.aeds-syria-notice svg {
  fill: #d97706;
  flex-shrink: 0;
  margin-top: 1px;
}
.kanzy-product-video {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.kanzy-product-video__title {
    font-size: 20px;
    margin: 0 0 12px;
    line-height: 1.3;
}

.kanzy-product-video__wrap {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.kanzy-product-video__player {
    width: 100%;
    height: auto;
    max-height: 420px;
    display: block;
    border-radius: 10px;
    background: #000;
}

@media (max-width: 768px) {
    .kanzy-product-video {
        padding: 12px;
        margin-top: 18px;
    }

    .kanzy-product-video__title {
        font-size: 17px;
        margin-bottom: 10px;
    }

    .kanzy-product-video__player {
        max-height: 220px;
        border-radius: 8px;
    }
}