/* BINFRND Phase 3: premium cross-page visual system */

:root {
  --p3-bg-1: #f3f7f3;
  --p3-bg-2: #fffbf4;
  --p3-ink: #1e3f20;
  --p3-glass: rgba(255, 255, 255, 0.72);
  --p3-line: rgba(30, 63, 32, 0.15);
}

body {
  color: var(--p3-ink);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(rgba(17,138,87,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,138,87,0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.5;
}

.section,
.section-alt,
.page-hero,
.search-hero,
.contact-hero,
.eco-hero {
  position: relative;
  overflow: hidden;
}

.section::before,
.section-alt::before,
.search-hero::before,
.contact-hero::before,
.eco-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 280px at 10% -8%, rgba(17,138,87,0.10), transparent 70%),
    radial-gradient(520px 260px at 100% 0, rgba(255,122,26,0.08), transparent 70%);
}

/* products list */
.search-hero {
  background:
    linear-gradient(155deg, #0c6f3f 0%, #139457 48%, #3ac883 100%);
}

.search-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.4px;
}

.search-box input {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.36);
}

.shop-layout {
  gap: 28px;
}

.filters {
  background: var(--p3-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--p3-line);
  box-shadow: 0 18px 40px rgba(9, 35, 23, 0.12);
}

.filter-chip {
  font-weight: 700;
}

.pcard {
  border: 1px solid var(--p3-line);
  box-shadow: 0 8px 26px rgba(9, 35, 23, 0.08);
}

.pcard:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 42px rgba(9, 35, 23, 0.15);
}

.pcard-body {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,251,246,0.92));
}

.meta-chip {
  border: 1px solid rgba(17,138,87,0.18);
}

/* product detail */
.pdp {
  max-width: 1280px;
}

.pdp-main {
  grid-template-columns: 1.05fr 0.95fr;
  gap: 38px;
}

.gallery-main {
  border: 1px solid var(--p3-line);
  box-shadow: 0 20px 44px rgba(9, 35, 23, 0.14);
  background: linear-gradient(160deg, #e7f7ee, #f9fff9);
}

.pdp-info h1 {
  letter-spacing: -0.3px;
}

.stock-badge {
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.variant-chip {
  border-radius: 14px;
  font-weight: 700;
}

.btn-cart,
.btn-buynow {
  box-shadow: 0 10px 28px rgba(9, 35, 23, 0.16);
}

.delivery-box,
.review-form,
.review-card {
  border: 1px solid var(--p3-line);
  box-shadow: 0 8px 22px rgba(9, 35, 23, 0.08);
  background: linear-gradient(180deg, #ffffff, #f5fcf7);
}

.tab-btn.active {
  font-weight: 800;
}

/* about */
#main-content .about-grid,
#main-content .about-values {
  align-items: stretch;
}

#main-content .about-value,
#main-content .benefit-card {
  border: 1px solid var(--p3-line);
  box-shadow: 0 10px 28px rgba(9, 35, 23, 0.10);
  background: linear-gradient(180deg, #fff, #f6fcf8);
}

#main-content .about-value:hover,
#main-content .benefit-card:hover {
  transform: translateY(-6px);
}

/* eco */
.eco-hero {
  background:
    linear-gradient(145deg, #0b6a3c 0%, #14995a 52%, #4bcf8a 100%);
}

.impact-card,
.cert-card,
.shame-stat {
  border: 1px solid var(--p3-line);
}

.impact-card {
  box-shadow: 0 12px 32px rgba(9, 35, 23, 0.12);
}

.impact-card:hover {
  transform: translateY(-7px);
}

.vs-table {
  border-radius: 18px;
  overflow: hidden;
}

/* contact */
.contact-hero {
  background:
    linear-gradient(145deg, #0a6d3f 0%, #119256 48%, #43c883 100%);
}

.cinfo-card,
.cform-card,
.wa-cta {
  border: 1px solid var(--p3-line);
  box-shadow: 0 16px 38px rgba(9, 35, 23, 0.14);
}

.cinfo-item {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(17, 138, 87, 0.14);
}

.cinfo-item:last-child {
  border-bottom: none;
}

.finput {
  border-radius: 12px;
}

/* mobile polish */
@media (max-width: 900px) {
  .pdp-main {
    grid-template-columns: 1fr;
  }

  .shop-layout {
    gap: 20px;
  }

  .search-hero h1 {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }
}

/* auth + checkout flow polish */
.auth-card {
  border: 1px solid var(--p3-line);
  box-shadow: 0 22px 56px rgba(9, 35, 23, 0.14);
}

.auth-tab.active {
  background: linear-gradient(180deg, rgba(17,138,87,0.08), transparent);
}

.co-wrap .fc,
.co-wrap .sumcard,
.ebill-modal {
  border: 1px solid var(--p3-line);
  box-shadow: 0 16px 40px rgba(9, 35, 23, 0.12);
}

.co-wrap .fc-head {
  background: linear-gradient(180deg, #f6fcf8, #eef8f2);
}

.co-wrap .dopt,
.co-wrap .popt {
  border-width: 2px;
}

.co-wrap .dopt.sel,
.co-wrap .popt.sel {
  box-shadow: 0 0 0 3px rgba(17,138,87,0.10);
}

/* ===== Phase 3.1: alignment + richer palette + mascot + assistant ===== */
.search-hero {
  background: linear-gradient(155deg, #0b6f3f 0%, #129a5b 40%, #46cf8a 100%) !important;
}

/* Proper product matrix alignment on homepage */
#products-preview .products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
}

#products-preview .products-grid .product-card {
  grid-column: auto !important;
}

#products-preview .product-card .product-img {
  height: 230px;
}

/* Transparent logo presentation */
.footer-logo-wrap,
.hero-logo-wrap {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.footer-logo-img,
.hero-logo-img {
  filter: drop-shadow(0 12px 22px rgba(5, 35, 22, 0.18));
}

/* 3D-ish earth mascot */
.hero-visual {
  position: relative;
}

.eco-mascot {
  position: absolute;
  right: -10px;
  bottom: -18px;
  width: 170px;
  height: 170px;
  perspective: 900px;
  z-index: 3;
  pointer-events: auto;
  cursor: pointer;
}

.eco-mascot .earth {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 35% 30%, #66d6ff 0%, #1da0df 45%, #0a5ea6 100%);
  box-shadow:
    inset -16px -16px 32px rgba(5, 29, 58, 0.35),
    inset 10px 10px 18px rgba(255,255,255,0.35),
    0 20px 34px rgba(8, 35, 22, 0.24);
  transform-style: preserve-3d;
  animation: earthBob 4.8s ease-in-out infinite;
}

.eco-mascot .earth::before,
.eco-mascot .earth::after {
  content: "";
  position: absolute;
  background: #9be23d;
  border-radius: 42% 58% 36% 64%;
  opacity: 0.95;
}

.eco-mascot .earth::before {
  width: 68px;
  height: 48px;
  left: 16px;
  top: 50px;
  transform: rotate(-16deg);
}

.eco-mascot .earth::after {
  width: 58px;
  height: 44px;
  right: 18px;
  top: 34px;
  transform: rotate(22deg);
}

.eco-mascot .arm,
.eco-mascot .leg {
  position: absolute;
  background: linear-gradient(180deg, #29be7f, #0f8d5c);
  border-radius: 999px;
}

.eco-mascot .arm {
  width: 52px;
  height: 14px;
  top: 78px;
}

.eco-mascot .arm.left { left: -36px; transform-origin: right center; animation: waveLeft 2.2s ease-in-out infinite; }
.eco-mascot .arm.right { right: -36px; transform-origin: left center; animation: waveRight 2.2s ease-in-out infinite; }

.eco-mascot .leg {
  width: 18px;
  height: 42px;
  bottom: -26px;
}

.eco-mascot .leg.left { left: 52px; }
.eco-mascot .leg.right { right: 52px; }

.eco-mascot .eye {
  position: absolute;
  top: 64px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0d3e31;
}

.eco-mascot .eye.left { left: 58px; }
.eco-mascot .eye.right { right: 58px; }

.eco-mascot .smile {
  position: absolute;
  left: 50%;
  top: 88px;
  width: 58px;
  height: 24px;
  transform: translateX(-50%);
  border-bottom: 5px solid #0d3e31;
  border-radius: 0 0 60px 60px;
}

/* Assistant widget */
.eco-assistant {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 1200;
}

.eco-assistant .assistant-toggle {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0db176, #0b8f63);
  color: #fff;
  font-weight: 800;
  padding: 12px 16px;
  box-shadow: 0 14px 30px rgba(8, 35, 22, 0.28);
  cursor: pointer;
}

.eco-assistant .assistant-toggle:hover {
  transform: translateY(-2px);
}

.eco-assistant .assistant-panel {
  width: 290px;
  border: 1px solid rgba(17,138,87,0.22);
  border-radius: 16px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(8, 35, 22, 0.20);
  padding: 14px;
  margin-bottom: 10px;
  display: none;
}

.eco-assistant.open .assistant-panel {
  display: block;
  animation: panelIn 0.26s ease-out;
}

.assistant-title {
  font-weight: 800;
  color: #0a5035;
  margin-bottom: 8px;
}

.assistant-msg {
  font-size: 0.84rem;
  color: #355546;
  line-height: 1.4;
  margin-bottom: 10px;
}

.assistant-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.assistant-actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(17,138,87,0.18);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0c5b3c;
  background: #f3fbf6;
}

.assistant-actions a:hover {
  background: #eaf8f1;
}

.assistant-wa {
  position: absolute;
  right: -4px;
  bottom: 62px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #18a54e);
  box-shadow: 0 10px 24px rgba(24, 165, 78, 0.38);
}

.assistant-wa:hover {
  transform: scale(1.08);
}

@keyframes earthBob {
  0%, 100% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translateY(-8px) rotateX(7deg) rotateY(-8deg); }
}

@keyframes waveLeft {
  0%, 100% { transform: rotate(18deg); }
  50% { transform: rotate(-18deg); }
}

@keyframes waveRight {
  0%, 100% { transform: rotate(-18deg); }
  50% { transform: rotate(18deg); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1000px) {
  #products-preview .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .eco-mascot {
    display: none;
  }
}

@media (max-width: 760px) {
  #products-preview .products-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   BINFRND Phase 3 — Responsive grid overrides only
   ========================================================= */

@media (max-width: 640px) {
  #products-preview .products-grid {
    grid-template-columns: 1fr !important;
  }
}
