/* ===== Dynamic Product Page Builder - section rendering ===== */

.pd-sections{display:flex;flex-direction:column;gap:48px}
.ps{width:100%}
.ps-heading{font-size:1.3rem;font-weight:800;letter-spacing:-.5px;margin-bottom:16px}
.ps-empty{color:var(--text-dimmer);font-size:.85rem}
.ps-caption{font-size:.78rem;color:var(--text-dim);margin-top:8px;text-align:center}

/* Rich text */
.ps-rich-text-body{font-size:.92rem;line-height:1.8;color:var(--text2);font-weight:300;max-width:800px}

/* Single image */
.ps-single-image-figure{margin:0}
.ps-single-image-figure img{width:100%;display:block;border-radius:16px}
.ps-single-image.ps-tpl-full_width .ps-single-image-figure img{border-radius:0}
.ps-single-image.ps-tpl-boxed .ps-single-image-figure{max-width:640px;margin:0 auto;padding:16px;background:var(--surface);border:1px solid var(--border);border-radius:20px}
.ps-single-image.ps-tpl-rounded .ps-single-image-figure img{border-radius:9999px / 24px}
.ps-single-image-figure figcaption{font-size:.78rem;color:var(--text-dim);margin-top:10px;text-align:center}

/* Two / three images */
.ps-two-images-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.ps-two-images.ps-tpl-overlap .ps-two-images-grid{grid-template-columns:1fr 1fr;position:relative}
.ps-two-images.ps-tpl-overlap .ps-two-images-grid figure:last-child{margin-top:40px}
.ps-three-images-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.ps-three-images.ps-tpl-row .ps-three-images-grid{grid-auto-flow:column;grid-template-columns:none}
.ps-two-images-grid img,.ps-three-images-grid img{width:100%;height:100%;object-fit:cover;border-radius:14px;display:block}
.ps-two-images-grid figure,.ps-three-images-grid figure{margin:0}

/* Gallery */
.ps-gallery-track{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.ps-gallery-track img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:14px;display:block}
.ps-gallery.ps-tpl-carousel .ps-gallery-track{display:flex;grid-template-columns:none;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:8px}
.ps-gallery.ps-tpl-carousel .ps-gallery-track figure{flex:0 0 260px;scroll-snap-align:start;margin:0}
.ps-gallery.ps-tpl-carousel .ps-gallery-track img{aspect-ratio:3/4}
.ps-gallery.ps-tpl-masonry .ps-gallery-track{display:block;columns:3 200px;column-gap:14px}
.ps-gallery.ps-tpl-masonry .ps-gallery-track figure{margin:0 0 14px;break-inside:avoid}
.ps-gallery-track figure{margin:0}

/* Text + image */
.ps-text-image{display:grid;grid-template-columns:1fr 1fr;gap:32px;align-items:center}
.ps-text-image-media img{width:100%;border-radius:16px;display:block}
.ps-text-image-body p{font-size:.92rem;line-height:1.8;color:var(--text2);font-weight:300}
.ps-text-image.ps-tpl-image_right{grid-template-columns:1fr 1fr}
.ps-text-image.ps-tpl-image_right .ps-text-image-media{order:2}
.ps-text-image.ps-tpl-image_right .ps-text-image-body{order:1}
.ps-text-image.ps-tpl-alternating:nth-of-type(even) .ps-text-image-media{order:2}
.ps-text-image.ps-tpl-alternating:nth-of-type(even) .ps-text-image-body{order:1}

/* Features list */
.ps-features-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px}
.ps-feature{display:flex;gap:14px;padding:18px;border-radius:14px;background:var(--surface);border:1px solid var(--border)}
.ps-feature i{font-size:1.1rem;color:var(--blue-light);flex-shrink:0}
.ps-feature strong{display:block;font-size:.9rem;margin-bottom:4px}
.ps-feature p{font-size:.8rem;color:var(--text-dim);margin:0}
.ps-features-list.ps-tpl-list .ps-features-grid{grid-template-columns:1fr}
.ps-features-list.ps-tpl-list .ps-feature{background:none;border:none;border-bottom:1px solid var(--border);border-radius:0;padding:14px 4px}
.ps-features-list.ps-tpl-icons .ps-feature{flex-direction:column;align-items:center;text-align:center}
.ps-features-list.ps-tpl-icons .ps-feature i{font-size:1.6rem}

/* Specs table */
.ps-specs{width:100%;border-collapse:collapse;max-width:800px}
.ps-specs td{padding:12px 16px;font-size:.85rem;border-bottom:1px solid var(--border)}
.ps-specs td:first-child{font-weight:600;color:var(--text-dim);width:220px}
.ps-specs-group{background:var(--surface);font-weight:700 !important;color:var(--text) !important}
.ps-specs-table.ps-tpl-grouped .ps-specs td{width:auto}

/* Video */
.ps-video-frame{position:relative;width:100%;aspect-ratio:16/9;border-radius:16px;overflow:hidden;background:#000}
.ps-video-frame iframe,.ps-video-frame video{width:100%;height:100%;border:0;display:block}
.ps-video.ps-tpl-boxed .ps-video-frame{max-width:800px;margin:0 auto}

/* FAQ */
.ps-faq-list{display:flex;flex-direction:column;gap:10px;max-width:800px}
.ps-faq-item{padding:16px 18px;border:1px solid var(--border);border-radius:14px;background:var(--surface)}
.ps-faq-item summary{cursor:pointer;font-weight:700;font-size:.9rem;list-style:none}
.ps-faq-item summary::-webkit-details-marker{display:none}
.ps-faq-item summary::after{content:'+';float:right;color:var(--text-dim)}
html[dir="rtl"] .ps-faq-item summary::after{float:left}
.ps-faq-item[open] summary::after{content:'−'}
.ps-faq-answer{margin-top:10px;font-size:.85rem;color:var(--text-dim);line-height:1.7}
.ps-faq.ps-tpl-list .ps-faq-item summary{cursor:default}
.ps-faq.ps-tpl-list .ps-faq-item summary::after{display:none}

/* Custom HTML - no default styling; author's markup controls its own look */
.ps-custom-html{overflow-x:auto}

/* CTA */
.ps-cta-inner{text-align:center;padding:40px;border-radius:20px;background:linear-gradient(135deg,var(--blue-main),var(--purple-main));color:#fff}
.ps-cta-inner .ps-heading{color:#fff}
.ps-cta-inner p{opacity:.9;margin-bottom:18px}
.ps-cta-btn{display:inline-flex;align-items:center;justify-content:center;padding:14px 28px;border-radius:12px;background:#fff;color:var(--blue-deep,#0652DD);font-weight:700;text-decoration:none;font-size:.85rem;letter-spacing:.5px}
.ps-cta.ps-tpl-split .ps-cta-inner{display:flex;align-items:center;justify-content:space-between;gap:20px;text-align:start}
.ps-cta.ps-tpl-split .ps-heading{margin-bottom:0}

/* Banner */
.ps-banner{position:relative;border-radius:20px;overflow:hidden;min-height:280px;display:flex;align-items:center}
.ps-banner-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0}
.ps-banner-bg::after{content:''}
.ps-banner-content{position:relative;z-index:1;padding:40px;color:#fff;background:linear-gradient(90deg,rgba(0,0,0,.65),transparent 70%);width:100%}
.ps-banner-content .ps-heading{color:#fff}
.ps-banner.ps-tpl-boxed{border-radius:24px;margin:0 auto;max-width:900px}

/* Product highlights */
.ps-highlights-row{display:flex;flex-wrap:wrap;gap:24px;justify-content:center}
.ps-highlight{display:flex;align-items:center;gap:8px;font-size:.82rem;font-weight:600}
.ps-highlight i{color:var(--accent-glow)}
.ps-product-highlights.ps-tpl-cards .ps-highlights-row{justify-content:flex-start}
.ps-product-highlights.ps-tpl-cards .ps-highlight{flex-direction:column;text-align:center;padding:18px;background:var(--surface);border:1px solid var(--border);border-radius:14px;min-width:120px}
.ps-product-highlights.ps-tpl-cards .ps-highlight i{font-size:1.4rem}

/* Comparison table */
.ps-comparison-scroll{overflow-x:auto}
.ps-comparison{width:100%;border-collapse:collapse;min-width:480px}
.ps-comparison th,.ps-comparison td{padding:12px 16px;font-size:.85rem;border-bottom:1px solid var(--border);text-align:start}
.ps-comparison th{color:var(--text-dim);font-weight:700;font-size:.72rem;text-transform:uppercase;letter-spacing:.5px}
.ps-comparison td:first-child{font-weight:600}

@media(max-width:768px){
    .ps-text-image,.ps-two-images-grid{grid-template-columns:1fr}
    .ps-text-image .ps-text-image-media,.ps-text-image .ps-text-image-body{order:initial !important}
    .ps-three-images-grid{grid-template-columns:repeat(2,1fr)}
    .ps-cta.ps-tpl-split .ps-cta-inner{flex-direction:column;text-align:center}
}
