/* ANBuyer — AliExpress-inspired layout (standalone, no external CDN) */

:root {
  --ae-bg: #f5f5f5;
  --ae-top: #191919;
  --ae-nav2: #fff;
  --ae-accent: #e43225;
  --ae-teal: #0d9488;
  --ae-blue: #1e40af;
  --ae-text: #222;
  --ae-muted: #666;
  --ae-card: #fff;
  --ae-radius: 8px;
  --ae-radius-lg: 12px;
  --ae-max: 1200px;
  --ae-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ae-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ae-price: #e43225;
  --ae-price-was: #9ca3af;
  --ae-section-gap: 48px;
  --ae-section-gap-sm: 28px;
  --ae-card-padding: 20px;
  --ae-border-soft: 1px solid #e8e8e8;
  --ae-border-subtle: 1px solid #e8e8e8;
  --ae-tile-title-size: 12px;
  --ae-tile-title-size-lg: 14px;
  --ae-tile-title-lh: 1.4;
  --ae-price-size: 16px;
  --ae-price-size-sm: 15px;
}

/* Skip link (keyboard / a11y) */
.ae-skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 10001;
  padding: 8px 16px;
  background: #222;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}

.ae-skip-link:focus,
.ae-skip-link:focus-visible {
  left: 16px;
  outline: 2px solid #f5a623;
  outline-offset: 2px;
}

.ae-home,
.ae-deals,
.ae-shipping-info,
.ae-business {
  --header-offset: 0px;
}

body.ae-home,
body.ae-deals,
body.ae-shipping-info,
body.ae-business {
  background: var(--ae-bg);
  font-family: var(--ae-font);
}

#main-content:focus {
  outline: none;
}

.ae-topbar a:focus-visible,
.ae-search button:focus-visible,
.ae-topbar-tools a:focus-visible,
.ae-nav-links a:focus-visible,
.ae-nav-pill:focus-visible,
.ae-hero-cta:focus-visible,
.ae-deal-card .ae-tile:focus-visible,
.ae-card-lg .ae-tile:focus-visible,
.ae-shop-all-more:focus-visible,
.ae-local-cta:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
}

/* ---- Top bar ---- */
.ae-topbar {
  background: var(--ae-top);
  color: #fff;
  padding: 12px 0;
}

.ae-topbar-inner {
  max-width: var(--ae-max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ae-logo {
  font-size: 22px;
  font-weight: 700;
  color: #fff !important;
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.ae-logo span {
  color: var(--ae-accent);
}

.ae-search {
  flex: 1;
  min-width: 200px;
  max-width: 720px;
  display: flex;
  align-items: stretch;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
}

.ae-search:focus-within {
  border-color: #f5a623;
}

.ae-search input {
  flex: 1;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
}

.ae-search button {
  background: #222;
  color: #fff;
  border: none;
  padding: 0 20px;
  cursor: pointer;
  font-size: 18px;
}

.ae-topbar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.ae-topbar-tools a {
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.ae-topbar-tools a:hover {
  text-decoration: underline;
}

.ae-cart-badge {
  background: var(--ae-accent);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 11px;
  margin-left: 4px;
}

/* ---- Secondary nav ---- */
.ae-nav-row {
  background: var(--ae-nav2);
  border-bottom: 1px solid #eee;
}

.ae-nav-row-inner {
  max-width: var(--ae-max);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ae-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ae-text);
  text-decoration: none;
  border: 1px solid #ddd;
  background: #fafafa;
}

.ae-nav-pill:hover {
  border-color: var(--ae-accent);
  color: var(--ae-accent);
}

.ae-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.ae-nav-links a {
  color: #333;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
}

.ae-nav-links a:hover {
  color: var(--ae-accent);
  background: #fff5f5;
}

/* ---- Hero carousel ---- */
.ae-hero-wrap {
  width: 100%;
}

.ae-hero-slide {
  display: none;
  min-height: 280px;
  padding: 36px 16px 28px;
  color: #fff;
  align-items: center;
  justify-content: center;
}

.ae-hero-slide.is-active {
  display: flex;
}

.ae-hero-inner {
  max-width: var(--ae-max);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.ae-hero-text h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin-bottom: 8px;
  font-weight: 700;
}

.ae-hero-text p {
  opacity: 0.95;
  font-size: 15px;
  margin-bottom: 12px;
}

.ae-hero-text .ae-end {
  font-size: 13px;
  opacity: 0.85;
}

.ae-hero-coupons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
  max-width: 520px;
}

.ae-hero-coupon {
  display: inline-block;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.3;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
}

.ae-hero-cta {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 22px;
  background: #fff;
  color: #111 !important;
  border-radius: 24px;
  font-weight: 600;
  text-decoration: none;
}

.ae-hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.ae-hero-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
}

.ae-hero-dots button.is-active {
  background: #fff;
  width: 22px;
  border-radius: 4px;
}

.ae-hero-right {
  width: min(280px, 36vw);
  height: 200px;
  flex-shrink: 0;
  border-radius: var(--ae-radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
}

.ae-hero-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Trust bar ---- */
.ae-trust {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 14px 16px;
}

.ae-trust-inner {
  max-width: var(--ae-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

@media (min-width: 600px) and (max-width: 991px) {
  .ae-trust-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
  }

  .ae-trust-item {
    align-items: flex-start;
  }
}

.ae-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #333;
}

.ae-trust-icon {
  font-size: 20px;
  line-height: 1;
}

/* ---- Section titles ---- */
.ae-section-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: var(--ae-section-gap) 0 20px;
  color: var(--ae-text);
}

/* ---- Deals two columns ---- */
.ae-deals-wrap {
  max-width: var(--ae-max);
  margin: 0 auto;
  padding: 0 16px var(--ae-section-gap);
}

.ae-deals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .ae-deals-grid {
    grid-template-columns: 1fr;
  }
}

.ae-deal-card {
  background: var(--ae-card);
  border-radius: var(--ae-radius-lg);
  border: var(--ae-border-subtle);
  padding: 20px;
  box-shadow: var(--ae-shadow);
}

.ae-deal-card__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 480px) {
  .ae-deal-card__head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
}

.ae-deal-card__head h3 {
  text-align: left;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ae-text);
}

.ae-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.ae-badge--green {
  background: #ecfdf3;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.ae-badge--red {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.ae-badge--pill {
  justify-content: flex-start;
  margin: 0;
  max-width: 100%;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ae-badge__icon {
  flex-shrink: 0;
}

.ae-badge__chev {
  opacity: 0.6;
  margin-left: 2px;
}

.ae-badge--countdown {
  font-variant-numeric: tabular-nums;
}

.ae-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
}

.ae-deal-card .ae-mini-grid .ae-tile,
.ae-local-right .ae-mini-grid .ae-tile {
  height: 100%;
}

@media (max-width: 600px) {
  .ae-mini-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Product mini tile ---- */
.ae-tile {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.ae-tile-img {
  aspect-ratio: 1;
  border-radius: var(--ae-radius);
  overflow: hidden;
  background: #f3f4f6;
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.ae-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ae-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ae-tile-title {
  font-size: var(--ae-tile-title-size);
  line-height: var(--ae-tile-title-lh);
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(var(--ae-tile-title-lh) * 2 * 1em);
}

.ae-tile-price-row {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.ae-tile-price {
  font-size: var(--ae-price-size-sm);
  font-weight: 700;
  color: var(--ae-price);
}

.ae-tile-was {
  font-size: 12px;
  color: var(--ae-price-was);
  text-decoration: line-through;
}

.ae-tile-badges {
  margin-top: 8px;
  min-height: 22px;
}

.ae-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.3;
}

.ae-pill--soft {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.ae-pill--deal {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.ae-tile-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ae-muted);
  line-height: 1.3;
}

.ae-tile-meta-sep {
  margin: 0 4px;
  opacity: 0.7;
}

.ae-tile-rating {
  color: #b45309;
  font-weight: 600;
}

/* ---- Local shipping split ---- */
.ae-local {
  max-width: var(--ae-max);
  margin: var(--ae-section-gap) auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--ae-radius-lg);
  overflow: hidden;
  box-shadow: var(--ae-shadow);
}

@media (max-width: 768px) {
  .ae-local {
    grid-template-columns: 1fr;
  }
}

.ae-local-left {
  padding: 0;
  color: #fff;
  display: flex;
  align-items: stretch;
}

.ae-local-left__inner {
  padding: 32px 28px;
  width: 100%;
}

.ae-local-left h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.ae-local-left p {
  opacity: 0.92;
  font-size: 14px;
  margin-bottom: 16px;
  max-width: 28em;
}

.ae-local-cta {
  display: inline-block;
  padding: 10px 22px;
  background: #fff;
  color: #111 !important;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.ae-local-cta:hover {
  filter: brightness(1.02);
}

.ae-local-right {
  padding: 18px;
}

.ae-local-right .ae-mini-grid {
  align-items: stretch;
}

/* ---- Shop all + main product grid ---- */
.ae-section-divider {
  max-width: var(--ae-max);
  margin: 0 auto;
  padding: 0 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ddd 15%, #ddd 85%, transparent);
}

.ae-shop-all-wrap {
  padding-top: 8px;
}

.ae-shop-all {
  padding-top: var(--ae-section-gap);
}

.ae-shop-all-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

@media (min-width: 640px) {
  .ae-shop-all-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.ae-shop-all-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ae-text);
  text-align: left;
}

.ae-shop-all-query {
  font-weight: 400;
  color: var(--ae-muted);
}

.ae-shop-all-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 14px;
  color: var(--ae-muted);
}

.ae-shop-all-more {
  color: var(--ae-blue);
  font-weight: 600;
  text-decoration: none;
}

.ae-shop-all-more:hover {
  text-decoration: underline;
}

.ae-shop-all-cap {
  font-size: 13px;
  color: #888;
}

.ae-main-grid-wrap {
  max-width: var(--ae-max);
  margin: 0 auto;
  padding: 0 16px 40px;
}

.ae-main-grid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.ae-main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.ae-card-lg {
  background: var(--ae-card);
  border-radius: var(--ae-radius-lg);
  overflow: hidden;
  box-shadow: var(--ae-shadow);
  transition: box-shadow 0.2s;
  border: var(--ae-border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.ae-card-lg:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ae-card-lg .ae-tile {
  flex: 1;
}

.ae-card-lg .ae-tile-img {
  aspect-ratio: 1;
  border-radius: var(--ae-radius);
  margin: 12px 12px 0;
}

.ae-card-lg .ae-tile-body {
  padding: 10px 12px 14px;
}

.ae-card-lg .ae-tile-title {
  font-size: var(--ae-tile-title-size-lg);
  line-height: var(--ae-tile-title-lh);
  min-height: calc(var(--ae-tile-title-lh) * 2 * 1em);
  padding: 0;
}

.ae-card-lg .ae-tile-price {
  font-size: var(--ae-price-size);
}

.ae-card-lg .ae-tile-price-row {
  margin-top: 8px;
  padding: 0;
}

.ae-empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  color: var(--ae-muted);
}

/* ---- Footer note ---- */
.ae-foot-note {
  max-width: var(--ae-max);
  margin: 0 auto 32px;
  padding: 0 16px;
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

/* ---- Float widgets ---- */
.ae-float {
  position: fixed;
  right: 12px;
  bottom: 80px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ae-float button,
.ae-float a {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: var(--ae-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  color: #333;
}

.ae-float a:hover,
.ae-float button:hover {
  border-color: var(--ae-accent);
}

/* ---- Business page ---- */
body.ae-business .ae-topbar {
  background: #0a0a0a;
}

.ae-biz-hero {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 40%, #134e4a 100%);
  color: #fff;
  padding: 40px 16px 48px;
}

.ae-biz-hero-inner {
  max-width: var(--ae-max);
  margin: 0 auto;
}

.ae-biz-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 12px;
  margin-bottom: 12px;
}

.ae-biz-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  margin-bottom: 10px;
}

.ae-biz-hero p {
  opacity: 0.92;
  margin-bottom: 20px;
}

.ae-biz-search {
  max-width: 560px;
  display: flex;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
}

.ae-biz-search input {
  flex: 1;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
}

.ae-biz-search button {
  background: #7c3aed;
  color: #fff;
  border: none;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 600;
}

.ae-biz-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ae-biz-quick span {
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

.ae-biz-benefits {
  max-width: var(--ae-max);
  margin: -24px auto 0;
  padding: 0 16px 32px;
  position: relative;
  z-index: 2;
}

.ae-biz-benefits-inner {
  background: #1e40af;
  color: #fff;
  border-radius: var(--ae-radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.ae-biz-benefits-inner h4 {
  font-size: 14px;
  margin-bottom: 6px;
}

.ae-biz-benefits-inner p {
  font-size: 12px;
  opacity: 0.9;
}

.ae-biz-section-title {
  max-width: var(--ae-max);
  margin: 32px auto 12px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 700;
}

/* ---- Shipping info static ---- */
.ae-static {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  background: #fff;
  border-radius: var(--ae-radius-lg);
  box-shadow: var(--ae-shadow);
}

.ae-static h1 {
  font-size: 24px;
  margin-bottom: 16px;
}

.ae-static p,
.ae-static li {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  margin-bottom: 10px;
}

.ae-static ul {
  padding-left: 20px;
}

/* ---- Deals page ---- */
.ae-deals-page-head {
  max-width: var(--ae-max);
  margin: 0 auto;
  padding: 20px 16px 8px;
}

/* Hide default container padding clash */
body.ae-home .main-wrap,
body.ae-deals .main-wrap,
body.ae-business .main-wrap,
body.ae-shipping-info .main-wrap {
  padding-top: 0;
  max-width: none;
}

body.ae-home .container.main-wrap,
body.ae-deals .container.main-wrap,
body.ae-business .container.main-wrap,
body.ae-shipping-info .container.main-wrap {
  padding-left: 0;
  padding-right: 0;
}
