/*
 * Ecogro responsive hardening layer.
 * Loaded after the original styles so the existing design and CMS remain intact.
 */

html { overflow-x: clip; }
body { min-width: 0; overflow-wrap: break-word; }
img, video, iframe, svg { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }
.page-width, .admin-workspace, .admin-content, main, section { min-width: 0; }

/* Keep desktop cards fluid between common laptop widths. */
@media (min-width: 801px) and (max-width: 1180px) {
  .site-header { grid-template-columns: 180px minmax(220px, 1fr) auto; gap: 16px; }
  .main-nav a { padding-inline: clamp(10px, 1.45vw, 17px); }
  .benefit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid, .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .testimonial-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: 30px; }
}

@media (max-width: 800px) {
  .announcement { min-height: 30px; padding-inline: 16px; text-align: center; }
  .hero { min-height: clamp(500px, 78svh, 620px); }
  .hero-content { padding-block: clamp(52px, 9vw, 72px); }
  .hero h1 { max-width: 12ch; font-size: clamp(2.75rem, 10vw, 4.35rem); }
  .hero-copy { font-size: 1rem; }
  .section-heading { gap: 18px; }
  .services-feature, .split-cta, .service-detail-layout, .form-layout,
  .cart-layout, .product-detail, .checkout-layout, .about-layout { gap: 32px; }
  .service-list-card { padding-inline: 20px; }
  .testimonial-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .testimonial-photo-card { height: clamp(430px, 70vw, 500px); }
  .testimonial-photo-content { padding: 25px 22px 23px; }
  .page-main { padding-block: 52px 76px; }
  .service-detail-hero { min-height: 540px; }
  .service-detail-overlay .page-width { padding-block: 52px; }
  .product-detail-image img { width: 100%; height: auto; max-height: 520px; aspect-ratio: 1 / 1; }
  .article-hero-image { height: auto; max-height: 480px; aspect-ratio: 16 / 10; }
  .shop-service-note, .care-help, .testimonial-band { padding: 34px; }
  .form-card, .contact-panel, .tracker-card { padding: 28px; }
  .footer-grid { gap: 34px; }
  .admin-content { overflow-x: hidden; }
  .module-toolbar { flex-wrap: wrap; }
  .admin-card { overflow: hidden; }
  .admin-table, .service-request-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 540px) {
  .page-width { width: calc(100% - 28px); }
  body, button, input, select, textarea { font-size: 16px; }
  p { line-height: 1.65; }
  h1 { font-size: clamp(2.55rem, 13vw, 3.35rem); }
  h2 { font-size: clamp(2rem, 10vw, 2.7rem); }
  .site-header { width: calc(100% - 24px); }
  .announcement { font-size: .65rem; }
  .hero { min-height: 520px; background-position: 62% center; }
  .hero-content { padding-block: 48px 72px; }
  .hero h1 { max-width: 11ch; }
  .hero-actions { max-width: none; }
  .hero-actions .button { width: 100%; }
  .benefit-grid { gap: 10px; }
  .benefit-item { min-height: 88px; }
  .content-section { padding-block: 48px; }
  .content-section + .content-section { padding-top: 6px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-card img { height: auto; aspect-ratio: 1 / .82; }
  .product-grid, .shop-grid, .service-grid, .project-grid, .article-grid { grid-template-columns: 1fr; }
  .product-image-wrap { aspect-ratio: 1 / .92; }
  .split-cta img { height: auto; aspect-ratio: 4 / 3; }
  .service-list-card { padding-inline: 16px; }
  .service-list-card a { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; }
  .homepage-testimonials { padding-block: 60px; }
  .testimonial-photo-grid { grid-template-columns: 1fr; }
  .testimonial-photo-card { height: min(470px, 126vw); min-height: 410px; }
  .testimonial-photo-content blockquote { font-size: .91rem; line-height: 1.55; }
  .testimonial-quote-medallion { width: 48px; height: 48px; margin-bottom: 14px; }
  .review-modal { overscroll-behavior: contain; }
  .review-modal-close { right: 12px; top: 12px; }
  .page-hero { min-height: 260px; }
  .page-hero h1 { font-size: clamp(2.35rem, 12vw, 3.1rem); }
  .page-hero p { font-size: .95rem; }
  .page-main { padding-block: 44px 66px; }
  .shop-service-note, .care-help, .testimonial-band,
  .form-card, .contact-panel, .tracker-card { padding: 24px 20px; }
  .service-detail-hero { min-height: 590px; }
  .service-detail-overlay .page-width { padding-block: 44px; }
  .back-link-light { margin-bottom: 30px; }
  .service-includes li { padding-right: 12px; }
  .consultation-service-card { grid-template-columns: 74px minmax(0, 1fr) 26px; }
  .consultation-service-card img { width: 74px; height: 88px; }
  .selected-service-detail { padding: 22px 18px; }
  .cart-line, .summary-row { min-width: 0; }
  .summary-row { align-items: start; }
  .summary-row > :last-child { text-align: right; }
  .footer-brand img { width: 170px; height: auto; }
  .floating-contact { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .floating-contact a { min-width: 48px; width: 48px; height: 48px; }
  .cookie-banner { padding: 16px; }
  .admin-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .admin-sidebar { width: 64px; padding-inline: 6px; }
  .admin-logo img { width: 50px; height: 44px; }
  .admin-content { padding: 16px 10px; }
  .admin-topbar { height: 64px; padding-inline: 10px; }
  .admin-user strong { max-width: 110px; }
  .metric-grid { gap: 10px; }
  .admin-card { padding: 14px; }
  .workflow-strip { grid-template-columns: 1fr 1fr; }
  .workflow-strip span:nth-child(2) { border-right: 0; }
  .workflow-strip span:nth-child(-n+2) { border-bottom: 1px solid #22352e; }
  .request-row { min-width: 860px; }
}

@media (max-width: 360px) {
  .page-width { width: calc(100% - 20px); }
  .brand, .brand img { width: 132px; }
  .category-grid { grid-template-columns: 1fr; }
  .consultation-service-card { grid-template-columns: 64px minmax(0, 1fr) 24px; gap: 9px; }
  .consultation-service-card img { width: 64px; height: 78px; }
}

@supports (padding: max(0px)) {
  .site-footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* v2 fidelity layer: neutralise legacy commerce-card rules that survive app.css. */
.category-card {
  display: block;
  min-height: 0;
  padding: 0 0 16px;
  border-radius: 0;
  overflow: hidden;
}
.category-card img {
  display: block;
  width: 100%;
  min-width: 100%;
  height: 150px;
  object-fit: cover;
}
.product-card { border-radius: 0; }
.product-image { aspect-ratio: 1 / .82; border-radius: 0; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.page-hero { background-image: linear-gradient(90deg, rgba(3,35,22,.89), rgba(3,35,22,.45)), url('/assets/img/ecogro/ecogro-hero.webp'); }

.services-showcase { padding-block: 84px; background: #082d1b; color: #fff; }
.services-showcase-grid { display: grid; grid-template-columns: minmax(280px,.8fr) minmax(0,1.2fr); gap: 56px; align-items: center; }
.services-showcase-copy h2 { max-width: 620px; margin: 10px 0 18px; font-size: clamp(2.35rem,4.4vw,4.5rem); }
.services-showcase-copy > p:not(.eyebrow) { max-width: 580px; color: #d5e5da; }
.services-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.service-preview-card { min-width: 0; overflow: hidden; background: #fff; color: var(--ink); }
.service-preview-card img { width: 100%; height: 150px; object-fit: cover; }
.service-preview-card div { padding: 15px 16px 17px; }
.service-preview-card strong,.service-preview-card span { display: block; }
.service-preview-card strong { color: var(--green-950); font: 700 1rem/1.25 Georgia,serif; }
.service-preview-card span { display: -webkit-box; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: .72rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.home-project-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); grid-auto-rows: 240px; gap: 14px; }
.home-project-card { position: relative; min-width: 0; overflow: hidden; background: var(--green-950); }
.home-project-card:first-child { grid-column: span 2; grid-row: span 2; }
.home-project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.home-project-card:hover img { transform: scale(1.03); }
.home-project-card::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent 38%,rgba(2,25,15,.86)); }
.home-project-card div { position:absolute; z-index:1; left:20px; right:20px; bottom:18px; color:#fff; }
.home-project-card span,.home-project-card strong { display:block; }
.home-project-card span { color:#cde3d3; font-size:.64rem; text-transform:uppercase; letter-spacing:.08em; }
.home-project-card strong { margin-top:5px; font:700 1.15rem Georgia,serif; }

@media (max-width: 1060px) {
  .services-showcase-grid { grid-template-columns: 1fr; }
  .home-project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 800px) {
  .services-showcase { padding-block: 64px; }
  .services-showcase-grid { gap: 34px; }
  .home-project-grid { grid-auto-rows: 220px; }
  .homepage-testimonials { padding-block: 72px; }
}

@media (max-width: 540px) {
  .category-card img { height: auto; aspect-ratio: 1.25 / 1; }
  .product-image { aspect-ratio: 1 / .86; }
  .services-card-grid { grid-template-columns: 1fr; }
  .service-preview-card { display:grid; grid-template-columns: 112px minmax(0,1fr); }
  .service-preview-card img { height:100%; min-height:125px; }
  .home-project-grid { grid-template-columns: 1fr; grid-auto-rows: 240px; }
  .home-project-card:first-child { grid-column:auto; grid-row:auto; }
  .homepage-testimonials { padding-block: 58px; }
}
