/*
 * EcomFlow - Product Page CSS (QuickTheme Parity)
 * Matched to QuickTheme 1.5 style.css dimensions & layout.
 */

/* ===== Single Product Wrapper ===== */
.single-product-wrapper {
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: start;
}

/* Standard/Hybrid Layout: Gallery left, Details right, Form full-width below */
.single-product-wrapper > .product-gallery {
    width: calc(50% - 12px);
    flex: 0 0 calc(50% - 12px);
}

.single-product-wrapper > .product-details {
    width: calc(50% - 12px);
    flex: 0 0 calc(50% - 12px);
}

.single-product-wrapper > .order-form-box {
    width: 100%;
    flex: 0 0 100%;
}

@media (max-width: 768px) {
    .single-product-wrapper > .product-gallery,
    .single-product-wrapper > .product-details,
    .single-product-wrapper > .order-form-box {
        width: 100%;
        flex: 0 0 100%;
    }
}

/* Product Content Flex Layout */
.single-product-wrapper > .product-content {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: start;
    margin-top: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    line-height: inherit;
    color: inherit;
}

/* Product Images (Gallery) */
.single-product-wrapper .product-images {
    width: calc(50% - 12px);
    flex: 0 0 calc(50% - 12px);
}

.single-product-wrapper .product-gallery {
    position: relative;
    width: 100%;
    border-radius: var(--theme-radius-lg, 12px);
    background: transparent;
}

.single-product-wrapper .product-gallery__track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.single-product-wrapper .gallery-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.single-product-wrapper .gallery-slide.active {
    display: block;
}

.single-product-wrapper .gallery-slide img,
.single-product-wrapper .gallery-slide .product-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: var(--theme-radius-sm, 4px);
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.1s ease-out;
}

/* Gallery Thumbnails */
.single-product-wrapper .product-images .gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    border: 2px solid transparent;
    border-radius: var(--theme-radius, 8px);
    overflow: hidden;
    position: relative;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
    border-color: var(--primary-color, #005f5a);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Gallery Zoom Trigger */
.gallery-zoom-trigger {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
z-index: 10;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.gallery-zoom-trigger::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #f8f8f8;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.gallery-zoom-trigger:hover {
    transform: scale(1.1);
}

.gallery-zoom-trigger:hover::before {
    opacity: 1;
}

.gallery-zoom-trigger svg {
    width: 20px;
    height: 20px;
}

/* Product Badge Discount */
.single-product-wrapper .product-badge-discount {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color, #005f5a);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
}

[dir="rtl"] .single-product-wrapper .product-badge-discount {
    left: auto;
    right: 15px;
}

/* Product Gallery Counter (Mobile) */
.product-gallery__counter {
    display: none;
}

.product-gallery__counter-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

/* Product Summary */
.single-product-wrapper .product-summary {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: calc(50% - 12px);
    flex: 0 0 calc(50% - 12px);
}

/* Product Breadcrumb */
.product-summary-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    padding: 0;
}

.product-summary-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-summary-breadcrumb a:hover {
    color: var(--primary-color, #005f5a);
}

.product-summary-breadcrumb .breadcrumb-separator {
    color: #999;
    margin: 0 4px;
}

.product-summary-breadcrumb .breadcrumb-current {
    color: #333;
    font-weight: 500;
}

/* Product Title */
.single-product-wrapper .product-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.3;
    text-align: start;
}

/* Product Star Rating */
.woocommerce-product-rating {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 12px;
    line-height: 1;
}

.woocommerce-product-rating .product-card-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.woocommerce-product-rating .woocommerce-review-link {
    font-size: 14px;
    font-weight: 400;
    color: #888;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.woocommerce-product-rating .woocommerce-review-link:hover {
    color: var(--primary-color, #005f5a);
}

.woocommerce-product-rating .product-card-star {
    width: 18px;
    height: 18px;
}

.woocommerce-product-rating .product-card-star svg {
    width: 18px;
    height: 18px;
}

/* Product Price */
.single-product-wrapper .product-summary .product-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color, #005f5a);
    margin-bottom: 16px;
    font-variant-numeric: normal;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    justify-content: flex-start;
}

.single-product-wrapper .product-summary .product-price del {
    font-size: 18px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
    margin-inline-end: 10px;
}

.single-product-wrapper .product-summary .product-price del .woocommerce-Price-amount {
    color: #999;
}

.single-product-wrapper .product-summary .product-price ins {
    text-decoration: none;
    font-size: 36px;
    font-weight: 700;
}

.single-product-wrapper .product-summary .product-price ins .woocommerce-Price-amount {
    color: var(--primary-color, #005f5a);
}

/* ===== Quill Content & Responsive Media ===== */
.product-content,
.lp-body-content {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-content img,
.product-page-content img,
.lp-body-content img,
.product-content video,
.product-page-content video,
.lp-body-content video,
.product-content iframe,
.product-page-content iframe,
.lp-body-content iframe {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 10px auto;
    display: block;
}

.product-description p {
    margin-bottom: 16px;
}

.product-description p:last-child {
    margin-bottom: 0;
}

.product-description h1,
.product-description h2,
.product-description h3,
.product-description h4 {
    margin-top: 24px;
    margin-bottom: 16px;
    color: #333;
}

.product-description ul,
.product-description ol {
    margin: 16px 0;
    padding-right: 20px;
}

.product-description li {
    margin-bottom: 8px;
}

/* ===== Store Features Grid ===== */
.dz-features-grid,
.shop-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    flex-wrap: wrap;
}

.dz-feature-item,
.shop-features .feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    flex: 1;
    min-width: 100px;
}

.dz-feature-icon,
.shop-features .icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
}

@media(max-width: 600px) {
    .dz-features-grid, .shop-features { gap: 15px; }
    .dz-feature-item, .shop-features .feature { font-size: 0.85rem; }
    .dz-feature-icon, .shop-features .icon { font-size: 1.5rem; }
}

/* ===== Variation Buttons ===== */
.product-variations-wrapper { margin-top: 25px; margin-bottom: 30px; }
.variation-attribute { margin-bottom: 20px; }
.variation-attribute h4 { font-size: 14px; font-weight: bold; color: #334155; margin-bottom: 12px; }
.variation-options { display: flex; flex-wrap: wrap; gap: 12px; }

.var-option-color {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid #e2e8f0;
    cursor: pointer; transition: all 0.2s; position: relative;
}
.var-option-color.active { border-color: #000; border-width: 3px; transform: scale(1.1); }

.var-option-btn {
    padding: 12px 20px; border-radius: 12px; border: 1px solid #e2e8f0;
    background: #fff; cursor: pointer; font-weight: bold; font-size: 14px;
    transition: all 0.15s ease; color: #334155;
}
.var-option-btn.active { border-color: #000 !important; border-width: 2px !important; background: #eef2ff; transform: scale(1.08); box-shadow: 0 0 0 2px rgba(0,0,0,0.08); }

.not-possible {
    opacity: 0.3 !important;
    pointer-events: none !important;
    position: relative;
    cursor: not-allowed !important;
}

.var-option-btn.not-possible {
    background-color: #f1f5f9;
    color: #94a3b8;
    overflow: hidden;
}
.var-option-btn.not-possible::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ef4444;
    transform: translateY(-50%) rotate(-45deg);
    opacity: 0.7;
}

.var-option-color.not-possible::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ef4444;
    transform: translateY(-50%) rotate(-45deg);
}
.var-option-color.not-possible::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ef4444;
    transform: translateY(-50%) rotate(45deg);
}

/* ===== Product Sticky Bottom Button ===== */
.product-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 12px 20px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.product-sticky-bottom.visible {
    transform: translateY(0);
}

.sticky-bottom-cta {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 20px;
    background: var(--confirm-button-bg, var(--primary-color, #005f5a));
    color: var(--confirm-button-text, #fff);
    border: none;
    border-radius: var(--theme-radius, 8px);
    font-size: 18px;
    font-weight: 500;
cursor: pointer;
    position: relative;
    z-index: 0;
    text-align: center;
}

.sticky-bottom-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--primary-color-hover, #004a46);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.sticky-bottom-cta:hover::before {
    opacity: 1;
}

/* ===== Gallery Lightbox ===== */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10001;
}

.lightbox-image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-in;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 1;
    z-index: 10002;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* ===== Landing Page ===== */
.lp-container {
    max-width: 100% !important;
    margin: 0 auto;
    background: #fff;
    box-shadow: none;
}

.lp-body-content {
    padding: 0 !important;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.lp-body-content img,
.lp-body-content video,
.lp-body-content iframe {
    width: 100% !important;
    max-width: 100% !important;
    /* CLS Fix: let browser reserve space before image loads */
    height: auto !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: block !important;
}

/* CLS Fix: img tags WITH explicit width/height attrs get auto aspect-ratio */
.lp-body-content img[width][height] {
    aspect-ratio: attr(width) / attr(height) !important;
}

/* Wrapper for full-width LP images to prevent layout shift */
.lp-img-wrap {
    display: block;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}
.lp-img-wrap img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

.lp-body-content h2 {
    margin-top: 40px;
    font-size: 1.8rem;
    border-right: 5px solid var(--primary-color, #005f5a);
    padding-right: 15px;
    margin-left: 20px;
    margin-right: 20px;
}

.lp-body-content p,
.lp-body-content ul,
.lp-body-content ol,
.lp-body-content div:not(.lp-gallery) {
    padding-left: 15px;
    padding-right: 15px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.lp-btn-order {
    background: var(--primary-color, #005f5a);
    color: #fff;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    display: block;
    text-align: center;
    font-size: 1.2rem;
animation: pulse 2s infinite;
    will-change: transform;
    border: none;
    width: 100%;
    cursor: pointer;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Product Page Form Wrapper (Global) ===== */
.product-page-form,
.order-form-box {
    background: #fff;
    border-radius: var(--theme-radius-lg, 12px);
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.product-page-form h2,
.product-page-form h3,
.order-form-box h2,
.order-form-box h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #333;
}

/* ===== Form CSS Variables ===== */
:root {
    --form-input-bg: #ffffff;
    --form-input-border: #e2e8f0;
    --form-input-text: #1e293b;
    --form-label-color: #334155;
    --form-input-radius: 12px;
}

#dz-order-form label {
    color: var(--form-label-color) !important;
    font-weight: 700 !important;
}

#dz-order-form input:not([type="radio"]):not([type="checkbox"]),
#dz-order-form select,
#dz-order-form textarea {
    color: var(--form-input-text) !important;
    background: var(--form-input-bg) !important;
    border: 1px solid var(--form-input-border) !important;
    border-radius: var(--form-input-radius) !important;
    outline: none !important;
}

#dz-order-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

[dir="rtl"] #dz-order-form select {
    background-position: right 12px center;
    padding-left: 14px;
    padding-right: 36px;
}

.dz-form-theme-modern input:not([type="radio"]):not([type="checkbox"]),
.dz-form-theme-modern select {
    border: 2px solid var(--form-input-border) !important;
    background: var(--form-input-bg) !important;
    border-radius: var(--form-input-radius) !important;
    padding: 14px 18px !important;
}

.dz-form-theme-modern input:focus,
.dz-form-theme-modern select:focus {
    border-color: var(--primary-color, #005f5a) !important;
    box-shadow: 0 0 0 4px rgba(168, 85, 47, 0.2) !important;
}

/* ===== Offer Cards ===== */
.offer-radio:checked + .offer-card {
    border-color: #D32F2F !important;
    background-color: #FFF5F5 !important;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.1);
}

.offer-badge {
    font-size: 10px;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-red { background: #D32F2F !important; color: #fff !important; }
.badge-green { background: #10B981 !important; color: #fff !important; }

.offer-timer {
    font-size: 10px;
    font-weight: 800;
    color: #D32F2F;
    background: #FFF5F5;
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #FED7D7;
}

/* ===== Product Page Content (Description - Global) ===== */
.product-page-content {
    background: #fff;
    border-radius: var(--theme-radius-lg, 12px);
    padding: 30px;
    margin-top: 24px;
    border: 1px solid #e5e7eb;
    line-height: 1.7;
    color: #334155;
}

.product-page-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
}

.product-page-content img,
.product-page-content video,
.product-page-content iframe {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px auto;
    display: block;
}

/* ===== Price Summary (Total) ===== */
.price-summary {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.6;
}

.price-summary > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.price-summary .total-row {
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 700;
    font-size: 16px;
}

/* ===== Submit Button ===== */
.btn-submit {
    width: 100%;
    height: 56px;
    padding: 0 24px;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--confirm-button-text, white);
    background: var(--confirm-button-bg, var(--primary-color, #005f5a));
    border: none;
    border-radius: var(--theme-radius, 8px);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    will-change: transform, filter;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    filter: brightness(110%);
}

.btn-submit:active {
    transform: scale(0.95);
}

/* ===== Out of Stock ===== */
.dz-out-of-stock-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 12px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    z-index: 20;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dz-out-of-stock-badge::before {
    content: '\1F6AB';
    font-size: 14px;
}

.out-of-stock-disabled {
    background: #94a3b8 !important;
    border-color: #94a3b8 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.8;
}

/* ===== Input Validation ===== */
.input-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ===== QuickFORM Compatibility ===== */
.single-product-wrapper .product-images,
.single-product-wrapper .product-summary {
    clear: none !important;
    float: none !important;
    box-sizing: border-box !important;
}

/* ===== Product Short Description ===== */
.product-short-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ===== Cart Quick Add ===== */
.cart-quick-add {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--theme-radius-lg, 12px);
    margin-bottom: 16px;
}

.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    max-width: 140px;
}

.qty-selector button {
    width: 44px;
    height: 44px;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-selector button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.qty-selector button:hover::before {
    opacity: 1;
}

.qty-selector input {
    border: none;
    text-align: center;
    width: 50px;
    font-weight: 900;
    font-size: 1.1rem;
    outline: none;
    -moz-appearance: textfield;
    padding: 0;
    background: transparent;
}

.qty-selector input::-webkit-inner-spin-button,
.qty-selector input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.total-label {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

.total-amount {
    font-size: 20px;
    font-weight: 900;
    color: var(--primary-color, #005f5a);
}

.btn-add-to-cart {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary-color, #005f5a);
    color: #fff;
    border: none;
    border-radius: var(--theme-radius, 8px);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
    will-change: transform, filter;
}

.btn-add-to-cart:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.btn-add-to-cart:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* ===== Form Separator ===== */
.form-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.form-separator::before,
.form-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.form-separator span {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ===== Form Labels ===== */
.form-label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    font-size: 14px;
}

/* ===== Field Error ===== */
.field-error {
    color: #ef4444;
    display: none;
    margin-top: 5px;
    font-weight: bold;
    font-size: 13px;
}

/* ===== Honeypot ===== */
.dz-honeypot {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
}

/* ===== Qty Selector Inline ===== */
.qty-selector-inline {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 140px;
    background: #fff;
    height: 45px;
}

.qty-selector-inline button {
    width: 45px;
    height: 100%;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
    z-index: 0;
}

.qty-selector-inline button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.qty-selector-inline button:hover::before {
    opacity: 1;
}

.qty-selector-inline input {
    border: none;
    text-align: center;
    width: 50px;
    font-weight: 900;
    font-size: 1.1rem;
    outline: none;
    -moz-appearance: textfield;
    padding: 0;
    background: transparent;
}

.qty-selector-inline input::-webkit-inner-spin-button,
.qty-selector-inline input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===== Offers Grid ===== */
.offers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.offer-card-wrapper {
    cursor: pointer;
    position: relative;
    display: block;
}

.offer-card {
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px;
    transition: all 0.3s;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
}

.offer-check {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.offer-check .check-inner {
    width: 12px;
    height: 12px;
    background: #D32F2F;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.offer-radio:checked + .offer-card .check-inner {
    opacity: 1;
}

.offer-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.offer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-info {
    flex: 1;
}

.offer-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 10px;
}

.offer-desc {
    font-weight: 900;
    font-size: 1.1rem;
    color: #1e293b;
}

.offer-info-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offer-price {
    font-weight: 900;
    color: #D32F2F;
    font-size: 1.2rem;
}

.offer-savings {
    font-size: 10px;
    color: #10B981;
    font-weight: bold;
}

.offer-free-shipping {
    font-size: 10px;
    background: #ECFDF5;
    color: #065F46;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.offer-timer .timer-display {
    font-family: monospace;
    font-size: 11px;
}

/* ===== Form Elements ===== */
#dz-order-form .form-group {
    margin-bottom: 16px;
}

#dz-order-form input:not([type="radio"]):not([type="checkbox"]),
#dz-order-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: var(--form-input-radius, 12px);
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s ease;
    will-change: border-color;
}

#dz-order-form input:focus,
#dz-order-form select:focus {
    outline: none;
    border-color: var(--primary-color, #005f5a);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #005f5a) 15%, transparent);
}

/* ===== Coupon Group ===== */
.coupon-input-wrap {
    display: flex;
    gap: 10px;
}

.coupon-input-wrap input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.coupon-input-wrap button {
    padding: 10px 20px;
    background: #1f2937;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    z-index: 0;
}

.coupon-input-wrap button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #374151;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.coupon-input-wrap button:hover::before {
    opacity: 1;
}

.coupon-message {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    min-height: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.coupon-message.show {
    opacity: 1;
    visibility: visible;
}

/* ===== Order Title Pulse ===== */
.order-title-pulse {
    animation: orderTitlePulse 2s ease-in-out infinite;
    will-change: transform;
}

@keyframes orderTitlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ===== Product Description Section ===== */
.product-description-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #e5e7eb;
}

.product-description-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.product-description-section img,
.product-description-section video,
.product-description-section iframe {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 16px auto;
    display: block;
}

/* ===== Product Tabs Section ===== */
.product-tabs-section {
    margin-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.product-tabs-section .woocommerce-tabs {
    margin-top: 20px;
}

.product-tabs-section .woocommerce-tabs .tabs.wc-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-tabs-section .woocommerce-tabs .tabs.wc-tabs li {
    margin: 0;
}

.product-tabs-section .woocommerce-tabs .tabs.wc-tabs li a {
    display: block;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.product-tabs-section .woocommerce-tabs .tabs.wc-tabs li.active a,
.product-tabs-section .woocommerce-tabs .tabs.wc-tabs li a:hover {
    color: var(--primary-color, #005f5a);
    border-bottom-color: var(--primary-color, #005f5a);
}

.product-tabs-section .woocommerce-Tabs-panel {
    padding: 24px 0;
}

.product-tabs-section .woocommerce-Tabs-panel h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.product-tabs-section .woocommerce-Tabs-panel p {
    line-height: 1.7;
    color: #334155;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .single-product-wrapper {
        padding: 0 16px;
    }

    .single-product-wrapper .product-content {
        flex-direction: column;
    }

    .single-product-wrapper .product-images,
    .single-product-wrapper .product-summary {
        width: 100%;
        flex: 0 0 100%;
    }

    .single-product-wrapper .product-images {
        position: static;
    }

    /* Mobile gallery: horizontal scroll, scroll-snap */
    .single-product-wrapper .product-gallery__counter {
        display: block;
        position: absolute;
        bottom: 12px;
        left: 12px;
        z-index: 6;
        pointer-events: none;
    }

    [dir="rtl"] .single-product-wrapper .product-gallery__counter {
        left: auto;
        right: 12px;
    }

    .single-product-wrapper .product-gallery__track {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .single-product-wrapper .product-gallery__track::-webkit-scrollbar {
        display: none;
    }

    .single-product-wrapper .gallery-slide {
        flex: 0 0 100%;
        width: 100%;
        position: relative;
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }

    .single-product-wrapper .product-gallery__track .gallery-slide:only-child {
        flex: 0 0 100%;
    }

    .single-product-wrapper .gallery-slide img,
    .single-product-wrapper .gallery-slide .product-gallery-image {
        position: static;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .single-product-wrapper .product-images .gallery-thumbnails {
        display: none;
    }

    .gallery-zoom-trigger {
        display: none;
    }

    .product-title {
        font-size: 24px;
    }

    .product-summary .price ins {
        font-size: 28px;
    }

    .woocommerce-Price-amount {
        font-size: 23px;
    }

    .product-summary-breadcrumb {
        font-size: 13px;
    }

    .product-description-section {
        margin-top: 32px;
        padding-top: 24px;
    }

    .product-description-section h2 {
        font-size: 20px;
    }

    .product-tabs-section .woocommerce-tabs .tabs.wc-tabs li a {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    .woocommerce-Tabs-panel {
        padding: 18px 14px 22px;
    }
}

/* ===== RTL Support ===== */
[dir="rtl"] .single-product-wrapper .product-gallery__counter {
    left: auto;
    right: 12px;
}

[dir="rtl"] .gallery-zoom-trigger {
    right: auto;
    left: 15px;
}

[dir="rtl"] .product-summary-breadcrumb {
    flex-direction: row-reverse;
}

[dir="rtl"] .product-summary-breadcrumb .breadcrumb-separator svg {
    transform: scaleX(-1);
}

[dir="rtl"] .product-tabs-section .woocommerce-tabs .tabs.wc-tabs {
    flex-direction: row-reverse;
}

/* ===== Animation on Scroll ===== */
.single-product-wrapper .product-images.animate-in,
.single-product-wrapper .product-summary.animate-in,
.single-product-wrapper .product-tabs-section.animate-in,
.single-product-wrapper .related-products-section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.single-product-wrapper .acc-checkout-box {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.single-product-wrapper .acc-checkout-box.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Form Heading (Global) ===== */
.form-heading {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

/* ===== Product Page Price (Global) ===== */
.product-page-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 15px;
    border: 1px dashed #ddd;
}

.product-page-price .compare-price {
    text-decoration: line-through;
    color: #64748B;
    font-size: 1.3rem;
}

.product-page-price .current-price {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--form-label-color, #334155);
    transition: color 0.3s;
}

/* ===== Coupon Button ===== */
.coupon-btn {
    padding: 10px 20px;
    background: #1f2937;
    color: #fff !important;
    border: none;
    border-radius: var(--form-input-radius, 0.75rem);
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
    z-index: 0;
}

.coupon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #374151;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.coupon-btn:hover::before {
    opacity: 1;
}

/* ===== dz-price-under-title (Global) ===== */
.dz-price-under-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dz-price-under-title .compare-price {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 1.1rem;
}

.dz-price-under-title .current-price {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--form-label-color, #334155);
    transition: color 0.3s;
}

/* ===== QuickForm (qf-*) Styles ===== */
.qf-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qf-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.qf-field {
    display: flex;
    align-items: center;
    border: 2px solid var(--form-input-border, #e2e8f0);
    border-radius: calc(var(--form-input-radius, 14) * 1px);
    background: var(--form-input-bg, #fff);
    transition: border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.qf-field:focus-within {
    border-color: var(--primary-color, #005f5a);
    box-shadow: 0 0 0 3px rgba(0, 95, 90, 0.08);
}

.qf-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    color: #94a3b8;
    border-inline-end: 1px solid #f1f5f9;
    align-self: stretch;
}

.qf-field-icon svg {
    width: 20px;
    height: 20px;
}

.qf-field input,
.qf-field select {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    background: transparent;
    color: var(--form-input-text, #1e293b);
    min-height: 52px;
    direction: rtl;
    text-align: right;
}

.qf-field input::placeholder {
    color: #94a3b8;
}

.qf-field select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.qf-field-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    flex-shrink: 0;
    color: #94a3b8;
    pointer-events: none;
}

.qf-field-chevron svg {
    width: 16px;
    height: 16px;
}

.qf-error-message {
    display: none;
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
    padding: 2px 4px;
}

.qf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .qf-row {
        grid-template-columns: 1fr;
    }
}

/* ===== QF Submit Row ===== */
.qf-submit-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.qf-qty {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.qf-qty button {
    width: 32px;
    height: 42px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    position: relative;
    z-index: 0;
}

.qf-qty button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #f1f5f9;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.qf-qty button:hover::before {
    opacity: 1;
}

.qf-qty button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qf-qty button svg {
    width: 16px;
    height: 16px;
}

.qf-qty input {
    width: 30px;
    border: none;
    text-align: center;
    font-weight: 900;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
    color: #1e293b;
    -moz-appearance: textfield;
    padding: 0;
    height: 42px;
}

.qf-qty input::-webkit-inner-spin-button,
.qf-qty input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qf-submit {
    flex: 1;
    height: 64px;
    padding: 0 36px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--confirm-button-text, #fff);
    background: var(--confirm-button-bg, var(--primary-color, #005f5a));
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    will-change: transform, filter;
}

.qf-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--confirm-button-bg, var(--primary-color, #005f5a)) 30%, transparent);
}

.qf-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== QF Coupon ===== */
.qf-coupon-wrap {
    margin-top: 4px;
}

.qf-coupon-toggle {
    display: flex;
    gap: 6px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
}

#qf-coupon-toggle-btn {
    color: var(--primary-color, #005f5a);
    font-weight: 700;
    text-decoration: underline;
}

.qf-coupon-field .qf-field {
    display: flex;
    align-items: center;
}

.qf-coupon-field .qf-field input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: #1e293b;
}

#qf-apply-coupon {
    padding: 0 20px;
    height: 100%;
    background: #1f2937;
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 0 12px 12px 0;
    position: relative;
    z-index: 0;
}

#qf-apply-coupon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #374151;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

[dir="rtl"] #qf-apply-coupon {
    border-radius: 12px 0 0 12px;
}

#qf-apply-coupon:hover::before {
    opacity: 1;
}

#qf-coupon-msg {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ===== QF Shipping ===== */
.qf-shipping-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
}

/* ===== QF Submit with Pulse (Landing) ===== */
.qf-submit.pulse {
    animation: pulse 2s infinite;
    border-radius: 50px;
    will-change: transform;
}

/* ===== Dark Preset Overrides for QF ===== */
body.preset-modern .qf-field,
body[data-preset="modern"] .qf-field,
body.preset-dark_elegance .qf-field,
body[data-preset="dark_elegance"] .qf-field {
    background: var(--form-input-bg, rgba(15, 15, 26, 0.9));
    border-color: var(--form-input-border, rgba(212, 175, 55, 0.3));
}

body.preset-modern .qf-field input,
body[data-preset="modern"] .qf-field input,
body.preset-dark_elegance .qf-field input,
body[data-preset="dark_elegance"] .qf-field input,
body.preset-modern .qf-field select,
body[data-preset="modern"] .qf-field select,
body.preset-dark_elegance .qf-field select,
body[data-preset="dark_elegance"] .qf-field select {
    color: var(--form-input-text, #f1f5f9);
    background: transparent;
}

body.preset-modern .qf-field-icon,
body[data-preset="modern"] .qf-field-icon,
body.preset-dark_elegance .qf-field-icon,
body[data-preset="dark_elegance"] .qf-field-icon {
    border-inline-end-color: rgba(212, 175, 55, 0.15);
    color: #d4af37;
}

body.preset-modern .qf-qty,
body[data-preset="modern"] .qf-qty,
body.preset-dark_elegance .qf-qty,
body[data-preset="dark_elegance"] .qf-qty {
    background: rgba(15, 15, 26, 0.9);
    border-color: rgba(212, 175, 55, 0.3);
}

body.preset-modern .qf-qty input,
body[data-preset="modern"] .qf-qty input,
body.preset-dark_elegance .qf-qty input,
body[data-preset="dark_elegance"] .qf-qty input {
    color: #f1f5f9;
}

body.preset-modern .qf-qty button,
body[data-preset="modern"] .qf-qty button,
body.preset-dark_elegance .qf-qty button,
body[data-preset="dark_elegance"] .qf-qty button {
    color: #d4af37;
}

/* ===== Info Boxes (Features) ===== */
.info-boxes-row {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 250px;
    justify-content: center;
}

.info-box-icon {
    width: 48px;
    height: 48px;
    background: color-mix(in srgb, var(--primary-color), transparent 85%);
    border-radius: var(--theme-radius-xl, 14px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-color);
}

.info-box-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.info-box-content p {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .info-boxes-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .info-box {
        justify-content: flex-start;
        width: 100%;
    }
}

/* Mobile: center landing page heading & form */
@media (max-width: 640px) {
    .lp-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .lp-container h2 {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        border-right: none !important;
        padding-right: 0 !important;
        width: 100%;
    }
    .lp-container #lp-order-form-section {
        width: 100%;
    }
}

/* ===================================================
   CLS Global Fix — LP Images
   عندما يُحوّل PHP الـ <p><img></p> إلى .lp-img-wrap
   نتأكد أنه لا يوجد margin/padding إضافي
   =================================================== */
.lp-img-wrap {
    display: block;
    width: 100%;
    line-height: 0;
    font-size: 0;
    overflow: hidden;
    /* CLS: يحجز المساحة بناءً على aspect-ratio الصورة الداخلية */
    contain: layout style;
}
.lp-img-wrap img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    /* منع browser من إضافة baseline spacing */
    vertical-align: bottom;
}

/* <p> تحتوي صورة فقط في lp-body-content: إزالة margin */
.lp-body-content p:has(> img:only-child) {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0;
    font-size: 0;
}

/* تحسين إضافي: aspect-ratio auto يجعل المتصفح يحجز المساحة
   عند وجود width/height attrs (مُضافة بواسطة PHP filter) */
.lp-body-content img[width][height] {
    aspect-ratio: attr(width) / attr(height);
}

/* Star Rating on Product Cards & Single Page */
.rl-prod-body .flex.items-center,
.rl-prod-details .flex.items-center,
.product-details .flex.items-center,
.sp-rating-row .flex.items-center {
    display: flex;
    align-items: center;
    gap: 1px;
    margin: 4px 0;
}
.rl-prod-body .fill-yellow-400,
.rl-prod-details .fill-yellow-400,
.product-details .fill-yellow-400,
.sp-rating-row .fill-yellow-400 {
    fill: #facc15;
}
.rl-prod-body .text-yellow-400,
.rl-prod-details .text-yellow-400,
.product-details .text-yellow-400,
.sp-rating-row .text-yellow-400 {
    color: #facc15;
}
.rl-prod-body .fill-yellow-400\/50,
.rl-prod-details .fill-yellow-400\/50,
.product-details .fill-yellow-400\/50,
.sp-rating-row .fill-yellow-400\/50 {
    fill: rgba(250, 204, 21, 0.5);
}
.rl-prod-body .text-gray-300,
.rl-prod-details .text-gray-300,
.product-details .text-gray-300,
.sp-rating-row .text-gray-300 {
    color: #d1d5db;
}
.rl-prod-body .text-muted-foreground,
.rl-prod-details .text-muted-foreground,
.product-details .text-muted-foreground,
.sp-rating-row .text-muted-foreground {
    color: #64748b;
    font-size: 12px;
}
.rl-prod-body .ml-1,
.rl-prod-details .ml-1,
.product-details .ml-1,
.sp-rating-row .ml-1 {
    margin-inline-start: 4px;
}
.rl-prod-body svg.lucide-star,
.rl-prod-details svg.lucide-star,
.product-details svg.lucide-star,
.sp-rating-row svg.lucide-star {
    width: 16px;
    height: 16px;
}

/* ==============================================
   Yalisoft-inspired Product Layout (sp-*)
   ============================================== */
.sp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}
.pp-layout {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}
.pp-layout .sp-grid {
    flex: 1;
    min-height: 0;
}
.pp-layout .sp-gallery {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.pp-layout .sp-image-wrap {
    width: 100%;
    aspect-ratio: 1;
}
.pp-layout .sp-info {
    overflow-y: auto;
    height: 100%;
}
@media (min-width: 768px) {
    .pp-layout .sp-grid {
        grid-template-rows: 1fr;
    }
}
.sp-back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}
.sp-back-link:hover {
    color: #111827;
}
.sp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 0;
}
@media (min-width: 768px) {
    .sp-grid {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
    }
    .sp-container {
        padding: 32px 24px 80px;
    }
}
.sp-gallery {
    position: relative;
}
.sp-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 280px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #f1f5f9;
    display: block;
    contain: layout style paint;
}
.sp-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}
.sp-badge-discount {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 9999px;
    z-index: 2;
    line-height: 1.4;
}
.sp-badge-out {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    z-index: 2;
}
.sp-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 12px;
}
.sp-thumb-item {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s;
}
.sp-thumb-item:hover {
    opacity: 1;
}
.sp-thumb-item.active {
    border-color: #111827;
    opacity: 1;
}
.sp-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sp-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sp-title {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.025em;
}
.sp-rating-row {
    margin: 0;
}
.sp-category {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
}
.sp-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sp-price-current {
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 900;
    color: #111827;
    line-height: 1;
}
.sp-price-original {
    font-size: clamp(16px, 1.5vw, 20px);
    color: #94a3b8;
    text-decoration: line-through;
}
.sp-desc {
    margin: 0;
    font-size: 20px;
    color: #475569;
    line-height: 1.7;
    white-space: pre-line;
}
.sp-stock {
    margin: 4px 0 0;
}
.sp-stock-in {
    font-size: 14px;
    font-weight: 600;
    color: #16a34a;
}
.sp-stock-out {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
}
.sp-separator {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 40px 0;
}
.sp-content-section {
    max-width: 100%;
}
.sp-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 20px;
}
.sp-content-body {
    font-size: 15px;
    color: #475569;
    line-height: 1.8;
}
.sp-content-body ul {
    list-style: disc;
    padding-inline-start: 20px;
}
.sp-content-body li {
    margin-bottom: 8px;
}

/* Landing layout overrides (single-column) */
.lp-layout {
    max-width: 100% !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    margin: 0;
    align-items: center;
}
.lp-layout > * {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.lp-layout > .lp-form-section {
    max-width: 600px;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 40px;
    padding-bottom: 40px;
}
.lp-form-section {
    max-width: 600px;
    margin: 0 auto;
}

/* LP Content Area - Ensure full width and scaled contents */
.lp-content-area { width: 100% !important; max-width: 100% !important; }
.lp-content-area img { width: 100% !important; max-width: 100% !important; height: auto !important; display: block; margin: 0 auto; object-fit: cover; }
.lp-content-area p, .lp-content-area h1, .lp-content-area h2, .lp-content-area h3, .lp-content-area h4, .lp-content-area h5, .lp-content-area h6 { text-align: center; }
@media (min-width: 768px) {
    .lp-content-area { font-size: 1.25rem; }
}

/* =====================================================
   DARK PRESET — Order Form Overrides (product.css)
   ===================================================== */

/* Dark Elegance */
body[data-preset="dark_elegance"],
body.preset-dark_elegance {
    --form-input-bg: #1e293b;
    --form-input-border: rgba(212, 175, 55, 0.2);
    --form-input-text: #f1f5f9;
    --form-label-color: #e2e8f0;
}

body[data-preset="dark_elegance"] .product-page-form,
body[data-preset="dark_elegance"] .order-form-box,
body.preset-dark_elegance .product-page-form,
body.preset-dark_elegance .order-form-box {
    background: #1a1a2e !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
    color: #f1f5f9 !important;
}

body[data-preset="dark_elegance"] .product-page-form h2,
body[data-preset="dark_elegance"] .product-page-form h3,
body[data-preset="dark_elegance"] .order-form-box h2,
body[data-preset="dark_elegance"] .order-form-box h3,
body[data-preset="dark_elegance"] .form-heading,
body.preset-dark_elegance .product-page-form h2,
body.preset-dark_elegance .product-page-form h3,
body.preset-dark_elegance .order-form-box h2,
body.preset-dark_elegance .order-form-box h3,
body.preset-dark_elegance .form-heading {
    color: #f1f5f9 !important;
}

body[data-preset="dark_elegance"] .product-page-content,
body.preset-dark_elegance .product-page-content {
    background: #1a1a2e !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
    color: #cbd5e1 !important;
}

body[data-preset="dark_elegance"] .product-page-content h2,
body.preset-dark_elegance .product-page-content h2 {
    color: #f1f5f9 !important;
}

body[data-preset="dark_elegance"] .price-summary,
body.preset-dark_elegance .price-summary {
    background: #0f172a !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
    color: #e2e8f0 !important;
}

body[data-preset="dark_elegance"] .price-summary .total-row,
body.preset-dark_elegance .price-summary .total-row {
    border-color: rgba(212, 175, 55, 0.25) !important;
}

body[data-preset="dark_elegance"] .product-page-price .compare-price,
body.preset-dark_elegance .product-page-price .compare-price {
    color: #94a3b8 !important;
}

body[data-preset="dark_elegance"] .qf-field,
body.preset-dark_elegance .qf-field {
    background: #1e293b !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

body[data-preset="dark_elegance"] .qf-field-icon,
body.preset-dark_elegance .qf-field-icon {
    color: #94a3b8 !important;
}

body[data-preset="dark_elegance"] .qf-qty,
body.preset-dark_elegance .qf-qty {
    background: #1e293b !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

body[data-preset="dark_elegance"] .qf-qty-plus,
body[data-preset="dark_elegance"] .qf-qty-minus,
body.preset-dark_elegance .qf-qty-plus,
body.preset-dark_elegance .qf-qty-minus {
    background: #2d3748 !important;
    color: #f1f5f9 !important;
}

body[data-preset="dark_elegance"] .qf-qty input,
body.preset-dark_elegance .qf-qty input {
    background: transparent !important;
    color: #f1f5f9 !important;
}

/* Modern Neon */
body[data-preset="modern"],
body.preset-modern {
    --form-input-bg: rgba(26, 26, 46, 0.9);
    --form-input-border: rgba(168, 85, 247, 0.25);
    --form-input-text: #e2e8f0;
    --form-label-color: #cbd5e1;
}

body[data-preset="modern"] .product-page-form,
body[data-preset="modern"] .order-form-box,
body.preset-modern .product-page-form,
body.preset-modern .order-form-box {
    background: rgba(26, 26, 46, 0.85) !important;
    border-color: rgba(168, 85, 247, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: #e2e8f0 !important;
}

body[data-preset="modern"] .product-page-form h2,
body[data-preset="modern"] .product-page-form h3,
body[data-preset="modern"] .order-form-box h2,
body[data-preset="modern"] .order-form-box h3,
body[data-preset="modern"] .form-heading,
body.preset-modern .product-page-form h2,
body.preset-modern .product-page-form h3,
body.preset-modern .order-form-box h2,
body.preset-modern .order-form-box h3,
body.preset-modern .form-heading {
    color: #f1f5f9 !important;
}

body[data-preset="modern"] .product-page-content,
body.preset-modern .product-page-content {
    background: rgba(26, 26, 46, 0.85) !important;
    border-color: rgba(168, 85, 247, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: #cbd5e1 !important;
}

body[data-preset="modern"] .price-summary,
body.preset-modern .price-summary {
    background: rgba(15, 15, 26, 0.6) !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
    color: #e2e8f0 !important;
}

body[data-preset="modern"] .product-page-price,
body.preset-modern .product-page-price {
    background: rgba(26, 26, 46, 0.85) !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
}

body[data-preset="modern"] .product-page-price .current-price,
body.preset-modern .product-page-price .current-price {
    color: #a855f7 !important;
}

body[data-preset="modern"] .product-page-price .compare-price,
body.preset-modern .product-page-price .compare-price {
    color: #94a3b8 !important;
}

body[data-preset="modern"] .qf-field,
body.preset-modern .qf-field {
    background: rgba(26, 26, 46, 0.9) !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
}

body[data-preset="modern"] .qf-qty,
body.preset-modern .qf-qty {
    background: rgba(26, 26, 46, 0.9) !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
}

body[data-preset="modern"] .qf-qty-plus,
body[data-preset="modern"] .qf-qty-minus,
body.preset-modern .qf-qty-plus,
body.preset-modern .qf-qty-minus {
    background: rgba(40, 40, 70, 0.9) !important;
    color: #e2e8f0 !important;
}

body[data-preset="modern"] .qf-qty input,
body.preset-modern .qf-qty input {
    background: transparent !important;
    color: #e2e8f0 !important;
}

/* Variation buttons dark mode */
body[data-preset="dark_elegance"] .var-option-btn,
body.preset-dark_elegance .var-option-btn {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: rgba(212, 175, 55, 0.25) !important;
}

body[data-preset="dark_elegance"] .var-option-btn.active,
body.preset-dark_elegance .var-option-btn.active {
    background: #2d3748 !important;
    border-color: #d4af37 !important;
}

body[data-preset="modern"] .var-option-btn,
body.preset-modern .var-option-btn {
    background: rgba(26, 26, 46, 0.9) !important;
    color: #e2e8f0 !important;
    border-color: rgba(168, 85, 247, 0.25) !important;
}

body[data-preset="modern"] .var-option-btn.active,
body.preset-modern .var-option-btn.active {
    background: rgba(168, 85, 247, 0.2) !important;
    border-color: #a855f7 !important;
}

/* ===== MODERN PRESET — Product Page Text & Layout Overrides ===== */
body[data-preset="modern"] .sp-back-link,
body.preset-modern .sp-back-link {
    color: #94a3b8 !important;
}
body[data-preset="modern"] .sp-back-link:hover,
body.preset-modern .sp-back-link:hover {
    color: #a855f7 !important;
}
body[data-preset="modern"] .sp-title,
body.preset-modern .sp-title {
    color: #f1f5f9 !important;
}
body[data-preset="modern"] .sp-category,
body.preset-modern .sp-category {
    color: #94a3b8 !important;
}
body[data-preset="modern"] .sp-price-current,
body.preset-modern .sp-price-current {
    color: #f1f5f9 !important;
}
body[data-preset="modern"] .sp-price-original,
body.preset-modern .sp-price-original {
    color: #64748b !important;
}
body[data-preset="modern"] .sp-desc,
body.preset-modern .sp-desc {
    color: #cbd5e1 !important;
}
body[data-preset="modern"] .sp-stock-in,
body.preset-modern .sp-stock-in {
    color: #4ade80 !important;
}
body[data-preset="modern"] .sp-section-title,
body.preset-modern .sp-section-title {
    color: #f1f5f9 !important;
}
body[data-preset="modern"] .sp-content-body,
body.preset-modern .sp-content-body {
    color: #cbd5e1 !important;
}
body[data-preset="modern"] .sp-content-body h1,
body[data-preset="modern"] .sp-content-body h2,
body[data-preset="modern"] .sp-content-body h3,
body.preset-modern .sp-content-body h1,
body.preset-modern .sp-content-body h2,
body.preset-modern .sp-content-body h3 {
    color: #f1f5f9 !important;
}
body[data-preset="modern"] .sp-image-wrap,
body.preset-modern .sp-image-wrap {
    background: #1a1a2e !important;
    border-color: rgba(168, 85, 247, 0.15) !important;
}
body[data-preset="modern"] .sp-thumb-item.active,
body.preset-modern .sp-thumb-item.active {
    border-color: #a855f7 !important;
}
body[data-preset="modern"] .sp-separator,
body.preset-modern .sp-separator {
    border-top-color: rgba(168, 85, 247, 0.15) !important;
}
body[data-preset="modern"] .form-label,
body.preset-modern .form-label {
    color: var(--form-label-color, #cbd5e1) !important;
}
body[data-preset="modern"] .sp-container,
body.preset-modern .sp-container {
    color: #e2e8f0 !important;
}
body[data-preset="modern"] .sp-rating-row .star,
body.preset-modern .sp-rating-row .star,
body[data-preset="modern"] .sp-rating-row svg,
body.preset-modern .sp-rating-row svg {
    color: #fbbf24 !important;
    fill: #fbbf24 !important;
}
body[data-preset="modern"] .text-gray-400,
body.preset-modern .text-gray-400 {
    color: #94a3b8 !important;
}
body[data-preset="modern"] .text-gray-600,
body.preset-modern .text-gray-600 {
    color: #94a3b8 !important;
}
body[data-preset="modern"] .bg-white,
body.preset-modern .bg-white {
    background-color: rgba(26, 26, 46, 0.8) !important;
}
body[data-preset="modern"] .bg-gray-50,
body.preset-modern .bg-gray-50 {
    background-color: rgba(26, 26, 46, 0.6) !important;
}
body[data-preset="modern"] .bg-gray-100,
body.preset-modern .bg-gray-100 {
    background-color: rgba(26, 26, 46, 0.5) !important;
}
body[data-preset="modern"] .border-gray-100,
body.preset-modern .border-gray-100 {
    border-color: rgba(168, 85, 247, 0.15) !important;
}
body[data-preset="modern"] .border-gray-200,
body.preset-modern .border-gray-200 {
    border-color: rgba(168, 85, 247, 0.15) !important;
}
body[data-preset="modern"] .hover\:bg-gray-200:hover,
body.preset-modern .hover\:bg-gray-200:hover {
    background-color: rgba(168, 85, 247, 0.15) !important;
}
body[data-preset="modern"] .text-indigo-600,
body.preset-modern .text-indigo-600 {
    color: #a855f7 !important;
}
body[data-preset="modern"] .text-indigo-800,
body.preset-modern .text-indigo-800 {
    color: #c084fc !important;
}
body[data-preset="modern"] h2[style*="background"],
body.preset-modern h2[style*="background"] {
    color: #f1f5f9 !important;
}
body[data-preset="modern"] .offer-card .offer-desc,
body.preset-modern .offer-card .offer-desc,
body[data-preset="modern"] .offer-card .offer-price,
body.preset-modern .offer-card .offer-price,
body[data-preset="modern"] .offer-card .offer-savings,
body.preset-modern .offer-card .offer-savings,
body[data-preset="modern"] .offer-card .offer-free-shipping,
body.preset-modern .offer-card .offer-free-shipping {
    color: #e2e8f0 !important;
}

/* ===== DARK ELEGANCE — Product Page Text, Sp-*, & Tailwind Overrides ===== */
body[data-preset="dark_elegance"] .sp-back-link,
body.preset-dark_elegance .sp-back-link {
    color: #94a3b8 !important;
}
body[data-preset="dark_elegance"] .sp-back-link:hover,
body.preset-dark_elegance .sp-back-link:hover {
    color: #d4af37 !important;
}
body[data-preset="dark_elegance"] .sp-title,
body.preset-dark_elegance .sp-title {
    color: #f1f5f9 !important;
}
body[data-preset="dark_elegance"] .sp-category,
body.preset-dark_elegance .sp-category {
    color: #94a3b8 !important;
}
body[data-preset="dark_elegance"] .sp-price-current,
body.preset-dark_elegance .sp-price-current {
    color: #f1f5f9 !important;
}
body[data-preset="dark_elegance"] .sp-price-original,
body.preset-dark_elegance .sp-price-original {
    color: #64748b !important;
}
body[data-preset="dark_elegance"] .sp-desc,
body.preset-dark_elegance .sp-desc {
    color: #cbd5e1 !important;
}
body[data-preset="dark_elegance"] .sp-stock-in,
body.preset-dark_elegance .sp-stock-in {
    color: #4ade80 !important;
}
body[data-preset="dark_elegance"] .sp-section-title,
body.preset-dark_elegance .sp-section-title {
    color: #f1f5f9 !important;
}
body[data-preset="dark_elegance"] .sp-content-body,
body.preset-dark_elegance .sp-content-body {
    color: #cbd5e1 !important;
}
body[data-preset="dark_elegance"] .sp-content-body h1,
body[data-preset="dark_elegance"] .sp-content-body h2,
body[data-preset="dark_elegance"] .sp-content-body h3,
body.preset-dark_elegance .sp-content-body h1,
body.preset-dark_elegance .sp-content-body h2,
body.preset-dark_elegance .sp-content-body h3 {
    color: #f1f5f9 !important;
}
body[data-preset="dark_elegance"] .sp-image-wrap,
body.preset-dark_elegance .sp-image-wrap {
    background: #1a1a2e !important;
    border-color: rgba(212, 175, 55, 0.15) !important;
}
body[data-preset="dark_elegance"] .sp-thumb-item.active,
body.preset-dark_elegance .sp-thumb-item.active {
    border-color: #d4af37 !important;
}
body[data-preset="dark_elegance"] .sp-separator,
body.preset-dark_elegance .sp-separator {
    border-top-color: rgba(212, 175, 55, 0.15) !important;
}
body[data-preset="dark_elegance"] .form-label,
body.preset-dark_elegance .form-label {
    color: var(--form-label-color, #e2e8f0) !important;
}
body[data-preset="dark_elegance"] .sp-container,
body.preset-dark_elegance .sp-container {
    color: #e2e8f0 !important;
}
body[data-preset="dark_elegance"] .sp-rating-row .star,
body.preset-dark_elegance .sp-rating-row .star,
body[data-preset="dark_elegance"] .sp-rating-row svg,
body.preset-dark_elegance .sp-rating-row svg {
    color: #fbbf24 !important;
    fill: #fbbf24 !important;
}
body[data-preset="dark_elegance"] .product-page-price,
body.preset-dark_elegance .product-page-price {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}
body[data-preset="dark_elegance"] .product-page-price .current-price,
body.preset-dark_elegance .product-page-price .current-price {
    color: #d4af37 !important;
}
body[data-preset="dark_elegance"] .price-summary,
body.preset-dark_elegance .price-summary {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
    color: #e2e8f0 !important;
}
body[data-preset="dark_elegance"] h2[style*="background"],
body.preset-dark_elegance h2[style*="background"] {
    color: #f1f5f9 !important;
}
body[data-preset="dark_elegance"] .offer-card .offer-desc,
body.preset-dark_elegance .offer-card .offer-desc,
body[data-preset="dark_elegance"] .offer-card .offer-price,
body.preset-dark_elegance .offer-card .offer-price,
body[data-preset="dark_elegance"] .offer-card .offer-savings,
body.preset-dark_elegance .offer-card .offer-savings,
body[data-preset="dark_elegance"] .offer-card .offer-free-shipping,
body.preset-dark_elegance .offer-card .offer-free-shipping {
    color: #e2e8f0 !important;
}

/* Tailwind utility overrides for dark_elegance product pages */
body[data-preset="dark_elegance"] .text-gray-400,
body.preset-dark_elegance .text-gray-400 {
    color: #94a3b8 !important;
}
body[data-preset="dark_elegance"] .text-gray-600,
body.preset-dark_elegance .text-gray-600 {
    color: #94a3b8 !important;
}
body[data-preset="dark_elegance"] .text-gray-700,
body.preset-dark_elegance .text-gray-700 {
    color: #cbd5e1 !important;
}
body[data-preset="dark_elegance"] .text-gray-500,
body.preset-dark_elegance .text-gray-500 {
    color: #94a3b8 !important;
}
body[data-preset="dark_elegance"] .text-slate-700,
body.preset-dark_elegance .text-slate-700 {
    color: #cbd5e1 !important;
}
body[data-preset="dark_elegance"] .bg-white,
body.preset-dark_elegance .bg-white {
    background-color: rgba(30, 41, 59, 0.85) !important;
}
body[data-preset="dark_elegance"] .bg-gray-50,
body.preset-dark_elegance .bg-gray-50 {
    background-color: rgba(30, 41, 59, 0.6) !important;
}
body[data-preset="dark_elegance"] .bg-gray-100,
body.preset-dark_elegance .bg-gray-100 {
    background-color: rgba(30, 41, 59, 0.5) !important;
}
body[data-preset="dark_elegance"] .border-gray-100,
body.preset-dark_elegance .border-gray-100 {
    border-color: rgba(212, 175, 55, 0.15) !important;
}
body[data-preset="dark_elegance"] .border-gray-200,
body.preset-dark_elegance .border-gray-200 {
    border-color: rgba(212, 175, 55, 0.15) !important;
}
body[data-preset="dark_elegance"] .hover\:bg-gray-200:hover,
body.preset-dark_elegance .hover\:bg-gray-200:hover {
    background-color: rgba(212, 175, 55, 0.1) !important;
}
body[data-preset="dark_elegance"] .text-indigo-600,
body.preset-dark_elegance .text-indigo-600 {
    color: #d4af37 !important;
}
body[data-preset="dark_elegance"] .text-indigo-800,
body.preset-dark_elegance .text-indigo-800 {
    color: #e2c76b !important;
}

/* =====================================================
   ULTRA-SMALL SCREEN FIXES (320px - 380px)
   Prevents horizontal overflow / clipped content
   on iPhone SE, small Androids, etc.
   ===================================================== */
@media (max-width: 380px) {

    /* --- Container padding reduction --- */
    .sp-container {
        padding: 16px 12px 40px;
    }

    /* --- Form wrapper padding reduction --- */
    .product-page-form,
    .order-form-box {
        padding: 16px !important;
    }

    /* --- Gallery image tweak --- */
    .sp-image-wrap {
        border-radius: 8px;
    }
    .sp-thumb-item {
        width: 56px;
        height: 56px;
    }

    /* --- Title & price sizes --- */
    .sp-title {
        font-size: 20px;
    }
    .sp-price-current {
        font-size: 24px;
    }
    .sp-price-original {
        font-size: 14px;
    }
    .sp-desc {
        font-size: 18px;
    }
    .sp-category {
        font-size: 14px;
    }

    /* --- Separator margin reduction --- */
    .sp-separator {
        margin: 20px 0;
    }

    /* --- Section title --- */
    .sp-section-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    .sp-content-body {
        font-size: 14px;
    }

    /* --- Variation buttons --- */
    .var-option-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .var-option-color {
        width: 38px;
        height: 38px;
    }
    .variation-options {
        gap: 8px;
    }
    .product-variations-wrapper {
        margin-top: 16px;
        margin-bottom: 16px;
    }
    .variation-attribute {
        margin-bottom: 12px;
    }

    /* --- Offers grid --- */
    .offers-grid {
        gap: 8px;
    }
    .offer-card {
        padding: 10px;
        gap: 8px;
    }
    .offer-check {
        width: 20px;
        height: 20px;
    }
    .offer-check .check-inner {
        width: 10px;
        height: 10px;
    }
    .offer-thumb {
        width: 52px;
        height: 52px;
    }
    .offer-desc {
        font-size: 13px;
    }
    .offer-price {
        font-size: 16px;
    }
    .offer-savings {
        font-size: 11px;
    }
    .offer-badge {
        font-size: 11px;
    }

    /* --- Form fields --- */
    .qf-fields {
        gap: 12px;
    }
    .qf-field {
        border-radius: 10px;
    }
    .qf-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* --- Submit row: stack vertically --- */
    .qf-submit-row {
        flex-direction: column;
        gap: 12px;
    }
    .qf-qty {
        justify-content: center;
        align-self: center;
    }
    .qf-submit {
        width: 100%;
        padding: 0 16px;
        font-size: 1.05rem;
        height: 52px;
        border-radius: 12px;
    }

    /* --- Info boxes --- */
    .info-boxes-row {
        gap: 12px;
    }
    .info-box {
        min-width: unset;
        gap: 10px;
    }
    .info-box-icon {
        width: 36px;
        height: 36px;
    }
    .info-box-icon svg {
        width: 18px;
        height: 18px;
    }
    .info-box-content p {
        font-size: 13px;
    }

    /* --- Price summary --- */
    .price-summary {
        padding: 10px !important;
        font-size: 14px;
    }

    /* --- Coupon field --- */
    .qf-coupon-toggle {
        font-size: 13px;
    }

    /* --- Back link --- */
    .sp-back-link {
        margin-bottom: 16px;
        font-size: 13px;
    }

    /* --- Cart section (Tailwind inline) --- */
    .product-page-form .flex.items-center.gap-4 {
        gap: 12px !important;
    }

    /* --- Landing layout --- */
    .lp-form-section {
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ===== CLS Prevention: Content Body Images ===== */
.sp-content-body img,
.lp-content-area img {
    max-width: 100%;
    height: auto;
    display: block;
}
.sp-content-body img[width][height],
.lp-content-area img[width][height] {
    aspect-ratio: attr(width) / attr(height);
}
.lp-img-wrap {
    display: block;
    margin: 1.5rem 0;
    line-height: 0;
}
.lp-img-wrap img {
    width: 100%;
    height: auto;
}

/* ===== CLS Prevention: Font Loading ===== */
html, body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== CLS Prevention: Gallery Images ===== */
.sp-image-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f1f5f9;
}
.sp-image-wrap #dz-main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sp-thumb-item img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ==================================================================
   Real CLS fix — DO NOT use content-visibility on above-the-fold grid.
   Reserve space via explicit aspect-ratios & dimensions instead.
   ================================================================== */

/* Reserve scrollbar gutter to prevent horizontal reflow when content
   becomes taller than viewport (eliminates body-level CLS). */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

/* Reserve main gallery image space — width/height are already rendered
   server-side (width="800" height="800"), aspect-ratio locks the box
   before the file arrives. */
.sp-image-wrap,
.sp-image-wrap #dz-main-image {
    aspect-ratio: 1 / 1;
    width: 100%;
}

/* Reserve thumbnail space — each thumb has width="80" height="80"
   server-rendered, plus aspect-ratio as a safety net. */
.sp-thumb-item,
.sp-thumb-item img {
    aspect-ratio: 1 / 1;
}

/* Body baseline — prevent any margin/scroll reflow around the grid. */
body {
    margin: 0;
    overflow-x: hidden;
}

/* ==================================================================
   REAL CLS FIX — Reserve space for rich-content section above form-box.
   The .sp-content-section sits ABOVE .order-form-box in pp-layout.
   If it contains images without width/height attributes (which is
   the case for raw HTML descriptions), the form-box gets pushed
   DOWN as those images load → the 0.618 CLS reported by PSI.
   content-visibility:auto keeps below-the-fold content off-screen
   until scroll, with contain-intrinsic-size reserving a stable
   placeholder so the form-box never slides.
   ================================================================== */
.sp-content-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
    contain: layout style paint;
}

/* Force any inline image inside the rich content to reserve its
   intrinsic box from first paint (CSS-level fallback even when
   the HTML forgot width/height attributes). Browsers honour
   aspect-ratio:auto + width:auto so the natural ratio kicks in
   immediately once bytes arrive, but we ALSO set a min block size
   to avoid a 0→N jump. */
.sp-content-body img:not([width]):not([height]),
.sp-content-body picture:not([width]) {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    background: #f1f5f9;
    min-height: 200px;
}
.sp-content-body img[width][height] {
    aspect-ratio: attr(width) / attr(height);
    width: auto;
    height: auto;
    max-width: 100%;
}

/* Lock gallery image reserve with an explicit min-height using
   container query units (cqw). This is a safety net in case the
   aspect-ratio box is overridden by a parent flex/grid stretch. */
.pp-layout .sp-image-wrap {
    min-height: 320px;
}
@media (min-width: 768px) {
    .pp-layout .sp-image-wrap {
        min-height: 400px;
    }
}

/* Stabilise offer price & form heading lines so a font swap can't
   cause text wrap changes that grow the form-box. */
.offer-desc,
.offer-price,
.form-heading,
.sp-title,
.sp-desc,
.product-page-price .current-price,
.product-page-price .compare-price {
    line-height: 1.25;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

/* Reserve stable height for sticky-order-btn so its IntersectionObserver
   visibility toggle can't cause a reflow. */
.sticky-order-btn {
    contain: layout style paint;
    will-change: transform, opacity;
}

/* ===== Product page body layout (extracted from inline <style>) ===== */
body.single-ef-product .main-product-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.single-ef-product .lp-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
}
body.single-ef-product .pp-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
}

