/* Custom typography & branding overrides */
body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
}

/* Homepage hero headline — editorial serif display face, loaded alongside Inter in index.php's <head>. */
.font-serif-display {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-optical-sizing: auto;
}

/*
 * Homepage hero (v2): full-bleed photo, dark gradient overlay, editorial
 * serif headline. Written as plain CSS rather than Tailwind utility
 * classes because css/tailwind.css is a pre-built, purged file with no
 * accessible build step in this environment — any Tailwind class not
 * already present in that compiled output (most color/spacing/arbitrary
 * values needed here) would silently fail to render. Keeping this
 * section's styling self-contained avoids that dependency entirely.
 */
.hero-v2 {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: #0b1220; /* shown briefly before the photo loads */
}
.hero-v2-bg {
    position: absolute;
    inset: 0;
}
.hero-v2-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transform: scaleX(-1); /* mirrors the photo so the panel/roof mass sits on the right, clear of the text column on the left */
    filter: brightness(1.45) saturate(1.15) contrast(0.95); /* the site is a solar calculator — lean the photo toward more visible sunlight rather than the storm-cloud half of the shot */
}
.hero-v2-overlay-x {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0b1220d8 0%, #0b1220a8 46%, #0b122040 78%, #0b122020 100%);
}
.hero-v2-overlay-y {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #0b1220d0 0%, transparent 32%, transparent 70%, #0b122055 100%);
}
.hero-v2-vertical-label {
    display: none;
    position: absolute;
    top: 4rem;
    bottom: 4rem;
    right: 1.5rem;
    z-index: 2;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    writing-mode: vertical-lr;
}
.hero-v2-inner {
    position: relative;
    z-index: 2;
    max-width: 80rem;
    margin: 0 auto;
    padding: 5.5rem 1.25rem;
}
.hero-v2-content {
    max-width: 34rem;
}
.hero-v2-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #6ee7b7;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.4rem;
}
.hero-v2-kicker-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #fbbf24; /* small warm accent — nods to the photo's sunset light without pulling the CTA off-brand */
    flex-shrink: 0;
}
.hero-v2-headline {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-optical-sizing: auto;
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin: 0 0 1.4rem;
}
.hero-v2-subtext {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 28rem;
    margin: 0 0 2.4rem;
}
.hero-v2-cta-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}
.hero-v2-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: #059669;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.9rem 1.5rem;
    border-radius: 0.85rem;
    box-shadow: 0 10px 20px -6px rgba(16, 185, 129, 0.45);
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    width: 100%;
}
.hero-v2-cta-primary:hover {
    background: #047857;
    transform: translateY(-1px);
}
.hero-v2-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 0.2rem;
    transition: border-color 0.2s ease;
    text-decoration: none;
    align-self: center;
}
.hero-v2-cta-secondary:hover {
    border-color: #fff;
}
.hero-v2-cta-secondary i {
    font-size: 0.7rem;
}
.hero-v2-trust {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 3.2rem;
    max-width: 24rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.72rem;
    line-height: 1.6;
}
.hero-v2-trust i {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .hero-v2-vertical-label { display: block; }
    .hero-v2-headline { font-size: 3.6rem; }
    .hero-v2-subtext { font-size: 1rem; }
    .hero-v2-inner { padding: 8rem 1.5rem; }
    .hero-v2-cta-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 1.1rem 2rem; }
    .hero-v2-cta-primary { width: auto; }
    .hero-v2-cta-secondary { align-self: auto; }
}
@media (min-width: 1024px) {
    .hero-v2-vertical-label { right: 2.5rem; }
}
@media (max-width: 767px) {
    .hero-v2-bg img { object-position: 75% top; } /* biases the crop toward the source photo's brighter, sunlit side — at narrow widths, a center crop mostly showed the storm-cloud half instead */
}

html {
    scroll-behavior: smooth;
}

/* Calculator configuration dialogs: keep controls reachable on short mobile viewports. */
.modal-dialog-scroll {
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.advanced-modal-hero{background:linear-gradient(135deg,#ecfdf5 0%,#f0fdfa 48%,#eff6ff 100%);border:1px solid #d1fae5;border-radius:1.25rem;padding:1rem}.advanced-modal-icon{width:2.75rem;height:2.75rem;border-radius:1rem;display:flex;align-items:center;justify-content:center;color:#047857;background:linear-gradient(135deg,#a7f3d0,#bfdbfe);box-shadow:0 8px 18px rgba(16,185,129,.16);font-size:1.05rem}.advanced-close-button{width:2.25rem;height:2.25rem;border-radius:.8rem;color:#64748b;background:rgba(255,255,255,.75);transition:all .2s ease}.advanced-close-button:hover{color:#0f172a;background:#fff;transform:rotate(90deg)}.advanced-live-status{display:flex;align-items:center;gap:.5rem;border:1px solid #a7f3d0;background:#f0fdf4;color:#047857;border-radius:.85rem;padding:.6rem .75rem;font-size:.68rem}.advanced-pulse-dot{width:.5rem;height:.5rem;border-radius:999px;background:#10b981;box-shadow:0 0 0 0 rgba(16,185,129,.55);animation:advancedPulse 1.8s infinite}.advanced-control-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.advanced-control-card{border:1px solid #e2e8f0;border-radius:1rem;padding:.85rem;background:#fff;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.advanced-control-card:hover{transform:translateY(-2px);border-color:#6ee7b7;box-shadow:0 10px 22px rgba(15,118,110,.09)}.advanced-control-heading{display:flex;align-items:center;gap:.65rem;margin-bottom:.7rem}.advanced-control-icon{width:2rem;height:2rem;border-radius:.7rem;display:flex;align-items:center;justify-content:center;font-size:.8rem}.advanced-control-icon.voltage{background:#dbeafe;color:#2563eb}.advanced-control-icon.sun{background:#fef3c7;color:#d97706}.advanced-control-icon.backup{background:#ede9fe;color:#7c3aed}.advanced-control-icon.battery{background:#dcfce7;color:#16a34a}.advanced-control-caption{font-size:.62rem;color:#94a3b8;margin-top:.12rem}.advanced-control-select{width:100%;padding:.62rem .7rem;border-radius:.7rem;border:1px solid #cbd5e1;background:#f8fafc;color:#334155;font-weight:700;font-size:.72rem;outline:none;transition:all .2s ease}.advanced-control-select:focus{border-color:#10b981;box-shadow:0 0 0 3px rgba(16,185,129,.14);background:#fff}.advanced-control-help{font-size:.61rem;color:#94a3b8;line-height:1.45;margin-top:.5rem}.advanced-summary-panel{margin-top:1rem;border:1px solid #bbf7d0;border-radius:1rem;background:linear-gradient(135deg,#f0fdf4 0%,#ecfeff 52%,#eff6ff 100%);padding:.9rem;color:#14532d;box-shadow:0 8px 18px rgba(16,185,129,.08)}.advanced-summary-panel .text-gray-500{color:#15803d}.advanced-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.45rem}.advanced-summary-item{border:1px solid rgba(16,185,129,.18);background:rgba(255,255,255,.72);border-radius:.7rem;padding:.55rem .4rem;text-align:center;box-shadow:0 3px 8px rgba(15,118,110,.05)}.advanced-summary-label{font-size:.55rem;color:#64748b;text-transform:uppercase;font-weight:800;letter-spacing:.08em}.advanced-summary-value{font-size:.7rem;color:#047857;font-weight:800;margin-top:.2rem}.advanced-done-button{padding:.7rem 1rem;border-radius:.8rem;background:linear-gradient(135deg,#059669,#047857);color:#fff;font-size:.75rem;font-weight:800;box-shadow:0 8px 16px rgba(5,150,105,.2);transition:all .2s ease}.advanced-done-button:hover{transform:translateY(-1px);box-shadow:0 10px 20px rgba(5,150,105,.28)}@keyframes advancedPulse{0%{box-shadow:0 0 0 0 rgba(16,185,129,.55)}70%{box-shadow:0 0 0 7px rgba(16,185,129,0)}100%{box-shadow:0 0 0 0 rgba(16,185,129,0)}}@media(max-width:640px){.advanced-control-grid{grid-template-columns:1fr}.advanced-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-live-status{align-items:flex-start;flex-wrap:wrap}.advanced-live-status .ml-auto{margin-left:0}.advanced-modal-hero{padding:.8rem}.advanced-modal-hero h2{font-size:1.05rem}.advanced-done-button{padding:.65rem .8rem}}
.advanced-panel-card{border:1px solid #bae6fd;border-radius:1rem;padding:.9rem;background:linear-gradient(135deg,#f0f9ff,#ecfeff);box-shadow:0 8px 18px rgba(14,165,233,.07)}.advanced-control-icon.panel{background:#cffafe;color:#0891b2}.advanced-field-label{display:block;font-size:.6rem;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.06em;margin:0 0 .35rem}


/* Stable fixed Advanced Configuration modal. */
#calculatorAdvancedModal {
    position: fixed !important;
    inset: 0;
    z-index: 2147483000 !important;
    isolation: isolate;
    box-sizing: border-box;
    padding: .75rem;
    align-items: center;
    justify-content: center;
}
#calculatorAdvancedModal > .modal-dialog-scroll {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-height: min(84vh, 62rem);
    overflow: hidden;
}
#calculatorAdvancedModal .advanced-modal-scroll-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: .15rem;
    padding-bottom: 1rem;
}
#calculatorAdvancedModal .advanced-modal-footer {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    margin-top: .75rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding: .65rem .25rem .15rem;
    border-top: 1px solid #d1fae5;
    background: #fff;
}
#calculatorAdvancedModal .advanced-modal-footer .advanced-done-button {
    flex: 0 0 auto;
    white-space: nowrap;
}
#calculatorAdvancedModal .advanced-close-button {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .16);
}
@media (max-width: 640px) {
    #calculatorAdvancedModal {
        padding-top: max(.5rem, env(safe-area-inset-top));
        padding-right: .5rem;
        padding-bottom: max(.5rem, env(safe-area-inset-bottom));
        padding-left: .5rem;
        align-items: flex-start !important;
        justify-content: center !important;
    }
    #calculatorAdvancedModal > .modal-dialog-scroll {
        width: 100%;
        max-height: calc(100dvh - 1rem);
        max-height: calc(100vh - 1rem);
        margin-top: .5rem;
        margin-bottom: .5rem;
    }
    #calculatorAdvancedModal .advanced-modal-hero {
        gap: .65rem;
    }
    #calculatorAdvancedModal .advanced-modal-hero > div:first-child {
        min-width: 0;
    }
    #calculatorAdvancedModal .advanced-modal-hero h2 {
        line-height: 1.2;
    }
    #calculatorAdvancedModal .advanced-modal-footer {
        gap: .65rem;
        align-items: center;
        margin-top: .65rem;
        padding-top: .65rem;
        padding-bottom: .1rem;
    }
    #calculatorAdvancedModal .advanced-modal-footer > span {
        max-width: 48%;
        line-height: 1.35;
    }
    #calculatorAdvancedModal .advanced-modal-footer .advanced-done-button {
        min-height: 2.75rem;
        padding-left: .8rem;
        padding-right: .8rem;
    }
}

/* Calculator mode transition: lightweight and independent from the Advanced Configuration modal. */
#calculatorModeContent.calculator-mode-fade-in {
    animation: calculatorModeFadeIn 260ms ease-out both;
}
@keyframes calculatorModeFadeIn {
    from { opacity: .68; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    #calculatorModeContent.calculator-mode-fade-in {
        animation: none;
    }
}
@media (max-width: 640px) {
    #calculatorModeContent.calculator-mode-fade-in {
        animation-duration: 210ms;
    }
}

/* All Guides & Articles image-led card layout */
.guide-card { min-height: 100%; }
.guide-card-image-link { background: #e8f4ef; overflow: hidden; }
.guide-card-image { display: block; width: 100%; height: 190px; object-fit: cover; object-position: center; transition: transform .35s ease; }
.guide-card:hover .guide-card-image { transform: scale(1.025); }
@media (max-width: 1023px) {
  .guide-card-image { height: 180px; }
}


/* Mobile navigation hardening: do not depend on Tailwind or Font Awesome for toggle visibility. */
.mobile-menu-toggle {
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid #d1d5db;
    border-radius: .75rem;
    background: #ffffff;
    color: #374151;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
.mobile-menu-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.15rem;
}
.mobile-menu-fallback { display: none; font-family: Arial, sans-serif; font-size: 1.25rem; }
@media (max-width: 1023px) {
    .mobile-menu-toggle { display: inline-flex !important; }
}
@media (min-width: 1024px) {
    .mobile-menu-toggle { display: none !important; }
}
@supports not (font-family: FontAwesome) {
    .mobile-menu-glyph > .fa-solid { display: none; }
    .mobile-menu-fallback { display: inline; }
}
@media (max-width: 1023px) {
    .mobile-menu-toggle .fa-bars,
    .mobile-menu-toggle .fa-xmark { display: inline-block; }
}


/* Package detail hero: product image inside the badges/title column.
   Written as a dedicated rule (not raw Tailwind utility classes) because
   this project's css/tailwind.css is a precompiled static bundle that only
   contains utilities already used elsewhere in the codebase at build time —
   arbitrary new classes like aspect-video and bg-amber-50/40 silently do
   nothing since they were never compiled in. See the Shopee/Lazada CTA
   buttons below for the same pattern. */
.package-hero-image {
    margin-top: 1.25rem;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 251, 235, .6);
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    overflow: hidden;
}
.package-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

/* Product marketplace CTAs — CalcSolarPH visual system.
   Marketplace brand colors are kept as subtle accents so affiliate CTAs feel native
   to the site's emerald/white/gray design rather than looking like external ads. */
.product-marketplace-cta {
    display: inline-flex !important;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .7rem 1rem;
    border: 1px solid #d1fae5 !important;
    border-radius: .85rem;
    background: #ffffff !important;
    color: #047857 !important;
    font-size: .875rem;
    font-weight: 800;
    line-height: 1.25rem;
    text-align: center;
    text-decoration: none !important;
    box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .07);
    transition: transform .22s ease, background-color .22s ease, border-color .22s ease,
                color .22s ease, box-shadow .3s ease, filter .22s ease;
}
.product-marketplace-cta:hover,
.product-marketplace-cta:focus-visible {
    color: #065f46 !important;
    background: #f0fdf4 !important;
    border-color: #6ee7b7 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 118, 110, .13);
    outline: none;
}
.product-marketplace-cta i {
    transition: transform .22s ease;
}
/* Compact variant: two-up marketplace buttons in tight card layouts (e.g. the
   homepage product teaser cards) where the full-width, 48px-min-height base
   style is too large. Written as a dedicated class — not Tailwind's `!w-auto
   !min-h-0` important-modifier utilities — because those specific arbitrary
   classes were never compiled into this project's static css/tailwind.css
   bundle and silently do nothing. */
.product-marketplace-cta--compact {
    width: auto;
    min-height: 0;
}
.product-marketplace-cta:hover i,
.product-marketplace-cta:focus-visible i {
    transform: translateY(-1px);
}

/* Shopee: native CalcSolarPH treatment with a subtle orange brand accent. */
.product-marketplace-cta--shopee {
    color: #047857 !important;
    border-color: #fdba74 !important;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%) !important;
    animation: ctaPulseShopee 2.8s ease-in-out infinite;
}
.product-marketplace-cta--shopee i {
    color: #f97316 !important;
}
.product-marketplace-cta--shopee:hover,
.product-marketplace-cta--shopee:focus-visible {
    color: #065f46 !important;
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%) !important;
    border-color: #fb923c !important;
    animation-play-state: paused;
    transform: scale(1.035) translateY(-2px);
    box-shadow: 0 9px 20px rgba(249, 115, 22, .16);
}

/* Lazada: hot-pink branding as a subtle accent, while the CTA keeps the
   CalcSolarPH emerald/white visual language. */
.product-marketplace-cta--lazada {
    color: #047857 !important;
    border-color: #f9a8d4 !important;
    background: linear-gradient(180deg, #ffffff 0%, #fffafd 100%) !important;
    animation: ctaPulseLazada 2.8s ease-in-out infinite;
}
.product-marketplace-cta--lazada i {
    color: #ec4899 !important;
}
.product-marketplace-cta--lazada:hover,
.product-marketplace-cta--lazada:focus-visible {
    color: #065f46 !important;
    background: linear-gradient(180deg, #ffffff 0%, #fdf2f8 100%) !important;
    border-color: #f472b6 !important;
    animation-play-state: paused;
    transform: scale(1.035) translateY(-2px);
    box-shadow: 0 9px 20px rgba(236, 72, 153, .16);
}

/* Soft marketplace glow: enough to preserve the requested hover/pulse treatment
   without turning the CTA into a neon ad element. */
@keyframes ctaPulseShopee {
    0%, 100% { box-shadow: 0 3px 10px rgba(234, 88, 12, .08); }
    50%      { box-shadow: 0 5px 17px rgba(234, 88, 12, .19); }
}
@keyframes ctaPulseLazada {
    0%, 100% { box-shadow: 0 3px 10px rgba(236, 72, 153, .07); }
    50%      { box-shadow: 0 5px 17px rgba(236, 72, 153, .18); }
}

@media (prefers-reduced-motion: reduce) {
    .product-marketplace-cta,
    .product-marketplace-cta--shopee,
    .product-marketplace-cta--lazada {
        transition: none;
        animation: none;
    }
}

@media (max-width: 639px) {
    .product-marketplace-cta { min-height: 48px; }
    .product-marketplace-cta-grid { grid-template-columns: minmax(0, 1fr); }
    .product-detail-page { overflow-x: hidden; }
    .product-detail-page .product-hero,
    .product-detail-page .product-buying-notes,
    .product-detail-page .product-info-grid > *,
    .product-detail-page .product-pros-cons-grid > * { min-width: 0; }
    .product-detail-page h1 { overflow-wrap: anywhere; }
}


/* Readable card imagery for Full Catalog and Packages. Images remain contained and never crop. */
.catalog-product-image {
    min-height: 250px;
    height: 250px !important;
}
.catalog-product-image-img {
    padding: 1rem !important;
}
.package-card-image {
    display: block;
    width: 100%;
    height: 240px !important;
    min-height: 220px;
    object-fit: contain !important;
    padding: .5rem !important;
}
@media (max-width: 639px) {
    .catalog-product-image {
        min-height: 220px;
        height: 220px !important;
    }
    .package-card-image {
        height: 210px !important;
        min-height: 190px;
    }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .catalog-product-image {
        min-height: 235px;
        height: 235px !important;
    }
    .package-card-image {
        height: 225px !important;
    }
}


/* Product detail hero: portrait card matching the supplied tall reference. */
.product-hero .product-image-panel {
    width: min(100%, 780px);
    aspect-ratio: 5 / 6;
    margin-inline: auto;
    min-height: 0;
    height: auto;
    padding: .5rem;
}
.product-hero .product-image-panel img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain;
}

/* Keep the v7 two-column desktop layout; place Buying Notes after Cons on mobile. */
.product-sections {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}
.product-details-card {
    grid-column: 1;
    grid-row: 1;
}
.product-buying-notes {
    grid-column: 2;
    grid-row: 1;
}
.product-pros-cons-grid {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
}
/* Compare table also needs to span the full grid width — without this it
   auto-places into column 1 only (2fr), leaving the 1fr column empty
   beside it. */
.product-compare-section {
    grid-column: 1 / -1;
}
@media (max-width: 1023px) {
    .product-sections {
        grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    }
}
/* Contextual affiliate links inserted from the Articles & Guides editor. */
a.product-affiliate-link {
    color: #047857;
    font-weight: 700;
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(5, 150, 105, 0.55);
    border-radius: .25rem;
    padding: .05rem .18rem;
    transition: color 150ms ease, background-color 150ms ease, text-decoration-color 150ms ease;
}
a.product-affiliate-link:hover {
    color: #065f46;
    background-color: rgba(167, 243, 208, .45);
    text-decoration-color: #047857;
}
a.product-affiliate-link:focus-visible {
    outline: 3px solid rgba(16, 185, 129, .45);
    outline-offset: 2px;
}
a.product-affiliate-link::after {
    content: "↗";
    display: inline-block;
    margin-left: .18em;
    font-size: .78em;
    font-weight: 800;
    text-decoration: none;
    vertical-align: .08em;
}
@media (prefers-reduced-motion: reduce) {
    a.product-affiliate-link { transition: none; }
}

@media (max-width: 767px) {
    .product-hero .product-image-panel {
        width: 100%;
        aspect-ratio: 5 / 6;
        min-height: 0;
        height: auto;
        padding: .5rem;
    }
    .product-hero .product-image-panel img {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: contain;
    }
    .product-sections {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    .product-details-card {
        order: 1;
    }
    .product-pros-cons-grid {
        order: 2;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
    .product-buying-notes {
        order: 3;
    }
    .product-compare-section {
        order: 4;
        margin-top: 0;
    }
}

/* Package-page FAQ accordions use a custom chevron icon instead of the
   browser's default <details> marker. */
details summary::-webkit-details-marker,
details summary::marker {
    display: none;
    content: "";
}

/* Broken product/hardware photo fallback (see includes/product-data.php
   product_image_fallback_attr() and the onerror handlers in
   products/index.php, packages/index.php, products/product.php, and
   js/solar-setup-planner.js). Dims the placeholder icon slightly so it
   reads as "no photo yet" rather than real content. */
img.image-fallback {
    opacity: .55;
    object-fit: contain;
    padding: 1.25rem;
    background: #f9fafb;
}

/* Homepage "Featured Products" cards (index.php) show each product's live
   description from Products Management, which varies a lot in length.
   Clamp it to 3 lines with an ellipsis so a long description on one card
   can't stretch that card taller than its neighbors and knock the
   price/Shopee/Lazada row out of alignment across the row. */
.hf-card-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}


/* CalcSolarPH brand mark: balanced desktop presentation with roomier navigation. */
.calcsolar-brand{display:inline-flex;align-items:center;min-width:0;flex:0 1 auto;border-radius:.9rem;transition:opacity .2s ease,transform .2s ease}
.calcsolar-brand:hover{opacity:.92;transform:translateY(-1px)}
.calcsolar-logo{display:block;width:clamp(13rem,18vw,16rem);height:auto;max-height:4.25rem;object-fit:contain;object-position:left center}
.site-desktop-nav{gap:.25rem}
.site-desktop-nav > *{min-width:0}
.site-desktop-nav > a,.site-desktop-nav > .group > button{white-space:nowrap;padding-left:.45rem;padding-right:.45rem}
@media(max-width:1180px) and (min-width:1024px){.calcsolar-logo{width:12.5rem}.site-desktop-nav{font-size:.78rem;gap:.1rem}.site-desktop-nav > a,.site-desktop-nav > .group > button{padding-left:.25rem;padding-right:.25rem}.site-header-actions button{padding-left:.55rem;padding-right:.55rem}}
@media(max-width:1023px){.site-header-actions{margin-left:auto}.calcsolar-logo{width:clamp(12.5rem,38vw,16rem);max-height:4.25rem}}
@media(max-width:640px){.calcsolar-logo{width:calc(100vw - 7rem);max-width:13.5rem;min-width:10.5rem;max-height:4.25rem}.calcsolar-brand{max-width:calc(100vw - 4.5rem)}}


/* Footer brand lockup: the light surface keeps the navy logo legible on the dark footer. */
.calcsolar-footer-brand{display:inline-flex;align-items:center;max-width:100%;border-radius:.9rem;transition:opacity .2s ease,transform .2s ease}
.calcsolar-footer-brand:hover{opacity:.92;transform:translateY(-1px)}
.calcsolar-footer-logo-wrap{display:inline-flex;align-items:center;padding:0;border-radius:0;background:transparent;box-shadow:none}
.calcsolar-footer-logo{display:block;width:clamp(12rem,18vw,15rem);height:auto;max-height:5rem;object-fit:contain}
@media(max-width:640px){.calcsolar-footer-logo{width:12.5rem;max-height:4.2rem}.calcsolar-footer-logo-wrap{padding:0}}
/* CalcSolarPH shared design system.
 * Page-specific layouts can remain specialized, but core surfaces, controls,
 * typography and spacing should come from this shared layer.
 */
:root {
    --csp-bg: #faf6ee;
    --csp-surface: #ffffff;
    --csp-surface-soft: #f7f3e9;
    --csp-border: #e4d9bc;
    --csp-border-soft: #ece3cd;
    --csp-border-neutral: #e5e7eb;
    --csp-text: #1f2937;
    --csp-muted: #6b7280;
    --csp-muted-dark: #4b5563;
    --csp-emerald-950: #064e3b;
    --csp-emerald-800: #065f46;
    --csp-emerald-700: #047857;
    --csp-emerald-600: #059669;
    --csp-emerald-100: #d1fae5;
    --csp-emerald-50: #ecfdf5;
    --csp-radius-card: 1.5rem;
    --csp-radius-control: .85rem;
    --csp-shadow-card: 0 4px 16px rgba(15, 23, 42, .055);
    --csp-shadow-hover: 0 10px 28px rgba(15, 118, 110, .10);
}

/* Shared page primitives */
.csp-page-shell {
    background: var(--csp-bg);
    color: var(--csp-text);
}
.csp-card {
    background: var(--csp-surface);
    border: 1px solid var(--csp-border-neutral);
    border-radius: var(--csp-radius-card);
    box-shadow: var(--csp-shadow-card);
}
.csp-card-soft {
    background: var(--csp-surface-soft);
    border: 1px solid var(--csp-border-soft);
    border-radius: 1rem;
}
.csp-kicker {
    color: var(--csp-emerald-700);
    font-size: .625rem;
    line-height: 1rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.csp-muted { color: var(--csp-muted); }
.csp-heading { color: #111827; }
.csp-button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.75rem;
    padding: .7rem 1.15rem;
    border: 1px solid var(--csp-emerald-700);
    border-radius: var(--csp-radius-control);
    background: var(--csp-emerald-700);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.csp-button-primary:hover,
.csp-button-primary:focus-visible {
    background: var(--csp-emerald-800);
    border-color: var(--csp-emerald-800);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(4, 120, 87, .16);
    outline: none;
}
.csp-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.75rem;
    padding: .7rem 1.15rem;
    border: 1px solid #d1d5db;
    border-radius: var(--csp-radius-control);
    background: #fff;
    color: #374151;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.csp-button-secondary:hover,
.csp-button-secondary:focus-visible {
    background: #fff;
    border-color: #a7f3d0;
    color: var(--csp-emerald-800);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(15, 23, 42, .07);
    outline: none;
}
.csp-input {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid #d1d5db;
    border-radius: var(--csp-radius-control);
    background: #fff;
    color: var(--csp-text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.csp-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .14);
}

/* Shared full-width page hero structure.
 * Individual pages may provide their own background/visual treatment.
 */
.csp-page-hero {
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Methodology & data pages: light, neutral "document" look instead of a
 * dark hero. These rules are intentionally NOT scoped to a body class -
 * a page just needs to use these class names and it renders correctly
 * regardless of which $bodyClass it sets. That was the root cause of a
 * prior bug: a page using .methodology-hero without also setting body
 * class "page-methodology" got an unstyled/invisible white-on-white hero.
 * De-scoping removes that whole class of mistake going forward.
 */
.csp-hero-card {
    background: var(--csp-surface);
    border: 1px solid var(--csp-border-neutral);
    border-radius: var(--csp-radius-card);
    box-shadow: var(--csp-shadow-card);
}
.methodology-content {
    background: var(--csp-surface);
    border: 1px solid var(--csp-border);
    border-radius: var(--csp-radius-card);
    box-shadow: var(--csp-shadow-card);
}
.methodology-content h2 { color: #111827; }
.methodology-content p,
.methodology-content li { color: #4b5563; }
.methodology-formula {
    background: var(--csp-surface-soft);
    border: 1px solid var(--csp-border-soft);
    color: #374151;
    border-radius: 1rem;
}
.methodology-note {
    background: var(--csp-emerald-50);
    border-color: var(--csp-emerald-100);
}
.methodology-note strong { color: var(--csp-emerald-950); }

/* Planner: keep its specialized planner visuals, but remove the separate slate design system. */
.planner-page {
    background: var(--csp-bg);
    color: var(--csp-text);
}
.planner-page .planner-surface,
.planner-page .planner-seo-card {
    background: var(--csp-surface);
    border-color: var(--csp-border-neutral);
    box-shadow: var(--csp-shadow-card);
}
.planner-page .planner-muted { color: var(--csp-muted); }
.planner-page .planner-title { color: #111827; }
.planner-page .planner-input,
.planner-page .planner-input-wrap {
    border-color: #d1d5db;
    border-radius: var(--csp-radius-control);
}
.planner-page .planner-input:focus,
.planner-page .planner-input-wrap:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .14);
}
.planner-page .planner-choice span {
    border-color: var(--csp-border-neutral);
    border-radius: 1rem;
}
.planner-page .planner-choice:hover span {
    border-color: #6ee7b7;
    background: var(--csp-emerald-50);
}
.planner-page .planner-choice input:checked + span {
    border-color: var(--csp-emerald-600);
    background: var(--csp-emerald-50);
    box-shadow: 0 0 0 2px var(--csp-emerald-100);
}
.planner-page .planner-metric,
.planner-page .market-card {
    background: var(--csp-surface-soft);
    border-color: var(--csp-border-soft);
}
.planner-page .market-card:hover {
    border-color: #6ee7b7;
    box-shadow: var(--csp-shadow-hover);
}
.planner-page .planner-dark-note {
    background: var(--csp-emerald-950);
    color: #d1fae5;
}
.planner-page .planner-dark-note strong { color: #fff; }

@media (max-width: 640px) {
    .methodology-content { border-radius: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .csp-button-primary,
    .csp-button-secondary,
    .csp-input { transition: none; }
}