/* 
 * OTS Premium Single Product CSS
 * Designed for Security Systems & Tech
 */

/* ===== Divi Container Overrides ===== */
.et_pb_section .ots-premium-single-product,
.et_pb_row .ots-premium-single-product,
.et_pb_column .ots-premium-single-product,
.et_pb_code_inner .ots-premium-single-product,
.et_pb_module .ots-premium-single-product {
    max-width: 95% !important;
    width: 95% !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

.et_pb_section:has(.ots-premium-single-product) {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.et_pb_row:has(.ots-premium-single-product) {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

.et_pb_column:has(.ots-premium-single-product) {
    padding: 0 !important;
    margin: 0 !important;
}

/* Container reset to our fonts and alignment */
.ots-premium-single-product {
    font-family: "IBM Plex Sans Arabic", sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
    max-width: 95% !important;
    width: 95% !important;
    margin: 0 auto !important;
    padding: 15px 0 20px !important;
    color: var(--ots-navy) !important;
}

.ots-premium-single-product * {
    font-family: inherit !important;
    text-align: right !important;
}

.ots-premium-single-product * {
    font-family: inherit !important;
}

/* Main Layout Grid */
.ots-product-main-area {
    display: grid !important;
    grid-template-columns: 45% 50% !important;
    gap: 5% !important;
    margin-bottom: 20px !important;
    align-items: start !important;
}

/* Breadcrumbs CSS */
.ots-breadcrumbs {
    margin-bottom: 25px !important;
}

.ots-breadcrumb-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.ots-breadcrumb-list li {
    font-size: 13px !important;
    color: #718096 !important;
}

.ots-breadcrumb-list li a {
    color: #718096 !important;
    text-decoration: none !important;
    transition: 0.3s !important;
}

.ots-breadcrumb-list li a:hover {
    color: var(--ots-cyan) !important;
}

.ots-breadcrumb-separator {
    color: #CBD5E0 !important;
    font-size: 11px !important;
}

.ots-breadcrumb-list li.active {
    color: var(--ots-navy) !important;
    font-weight: 700 !important;
}

/* Accessibility: Focus States */
.ots-premium-single-product a:focus,
.ots-premium-single-product button:focus {
    outline: 2px solid var(--ots-cyan) !important;
    outline-offset: 2px !important;
}

/* Gallery Side */
.ots-product-gallery-side {
    position: sticky !important;
    top: 50px !important;
}

.ots-custom-gallery {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

.ots-main-image {
    width: 100% !important;
    border-radius: 12px !important;
    border: 1px solid var(--ots-border) !important;
    background: #fff !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 0 !important;
}

/* لا تمتد الصورة بعرض العمود بالكامل — حجم أوضح على الشاشات */
.ots-main-image img {
    width: auto !important;
    max-width: min(100%, 440px) !important;
    max-height: min(70vh, 520px) !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin-inline: auto !important;
}

.ots-thumbnails {
    display: flex !important;
    gap: 15px !important;
    overflow-x: auto !important;
    padding-bottom: 5px !important;
}

.ots-thumbnails::-webkit-scrollbar {
    height: 6px !important;
}

.ots-thumbnails::-webkit-scrollbar-thumb {
    background: #CBD5E0 !important;
    border-radius: 4px !important;
}

.ots-thumb-item {
    flex: 0 0 calc(25% - 11.25px) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

.ots-thumb-item img {
    width: 100% !important;
    height: auto !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    transition: 0.3s !important;
    background: #fff !important;
}

.ots-thumb-item:hover img {
    border-color: #A0AEC0 !important;
}

/* Summary Side */
.ots-product-summary-side {
    padding-top: 10px !important;
}

.ots-single-title {
    font-size: 32px !important;
    font-weight: 800 !important;
    color: var(--ots-navy) !important;
    margin-bottom: 20px !important;
    line-height: 1.4 !important;
}

.ots-single-rating {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
}

.ots-rating-count {
    font-size: 14px !important;
    color: var(--ots-text-muted) !important;
}

.ots-single-price {
    font-size: 26px !important;
    font-weight: 900 !important;
    color: var(--ots-navy) !important;
    display: flex !important;
    gap: 15px !important;
    align-items: center !important;
    margin: 0 !important;
    flex-direction: row !important;
}

.ots-single-price del {
    font-size: 16px !important;
    color: var(--ots-text-muted) !important;
    font-weight: 600 !important;
}

.ots-single-price ins {
    text-decoration: none !important;
}

/* Excerpt / Short Description */
.ots-single-short-desc {
    font-size: 14px !important;
    color: #4A5568 !important;
    line-height: 1.8 !important;
    margin-bottom: 20px !important;
}

/* Security Badges */
.ots-security-badges {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 25px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
}

.ots-badge {
    background: #EBF8FF !important;
    color: #2B6CB0 !important;
    padding: 8px 15px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    border: 1px solid #BEE3F8 !important;
}

.ots-badge svg {
    width: 16px !important;
    height: 16px !important;
}

/* Custom Add To Cart Box */
.ots-single-add-to-cart-box {
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    background: #FAFBFC !important;
    /* Soft distinct background */
    padding: 25px !important;
    /* Critical for breathing room */
    margin-bottom: 35px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
}

.ots-price-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 25px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px dashed #E2E8F0 !important;
    /* Separation line */
}

.ots-price-label {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ots-navy) !important;
}

/* كارت خيار التركيب — بين أيقونات الدفع وصندوق الشراء */
#ots-single-app-wrap .ots-installation-single-card {
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    background: #fff !important;
    padding: 22px 24px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

#ots-single-app-wrap .ots-installation-select-wrap {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

#ots-single-app-wrap .ots-installation-select-label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #c53030 !important;
    margin-bottom: 6px !important;
}

#ots-single-app-wrap .ots-installation-select-label .required {
    color: #c53030 !important;
    text-decoration: none !important;
    border: none !important;
}

#ots-single-app-wrap .ots-installation-select-hint {
    margin: 0 0 10px 0 !important;
    font-size: 12px !important;
    color: #718096 !important;
}

#ots-single-app-wrap select.ots-wants-installation {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 52px !important;
    padding: 12px 40px 12px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ots-navy) !important;
    background-color: #fff !important;
    border: 2px solid #d4a574 !important;
    border-radius: 12px !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231B365D' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 16px center !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

#ots-single-app-wrap select.ots-wants-installation:focus {
    outline: none !important;
    border-color: var(--ots-cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.2) !important;
}

/* Action Row (Quantity + Button) */
#ots-single-app-wrap .ots-action-row form.cart {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    flex-wrap: wrap !important;
}

#ots-single-app-wrap .ots-action-row form.cart::before,
#ots-single-app-wrap .ots-action-row form.cart::after {
    display: none !important;
    content: none !important;
}

#ots-single-app-wrap .ots-action-row form.cart .quantity {
    display: inline-flex !important;
    order: 2 !important;
    /* Forces it to the left side in RTL layout */
    margin: 0 !important;
}

#ots-single-app-wrap .ots-action-row form.cart .quantity .plus:not(.ots-qty-btn),
#ots-single-app-wrap .ots-action-row form.cart .quantity .minus:not(.ots-qty-btn) {
    display: none !important;
}

/* Custom Quantity Wrapper Pill */
#ots-single-app-wrap .ots-qty-wrapper {
    display: flex !important;
    align-items: center !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 30px !important;
    height: 48px !important;
    background: #fff !important;
    overflow: hidden !important;
    width: 130px !important;
}

#ots-single-app-wrap .ots-qty-btn {
    background: transparent !important;
    border: none !important;
    color: #4A5568 !important;
    font-size: 20px !important;
    width: 40px !important;
    height: 100% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

#ots-single-app-wrap .ots-qty-btn:hover {
    background: #F8FAFC !important;
    color: var(--ots-navy) !important;
}

#ots-single-app-wrap .ots-qty-wrapper input.qty {
    border: none !important;
    border-left: 1px solid #E2E8F0 !important;
    border-right: 1px solid #E2E8F0 !important;
    background: transparent !important;
    height: 100% !important;
    width: 50px !important;
    padding: 0 !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ots-navy) !important;
    font-family: inherit !important;
    border-radius: 0 !important;
    appearance: textfield !important;
    -moz-appearance: textfield !important;
    box-shadow: none !important;
    margin: 0 !important;
}

#ots-single-app-wrap .ots-qty-wrapper input.qty::-webkit-outer-spin-button,
#ots-single-app-wrap .ots-qty-wrapper input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Custom Dark Button without icon */
#ots-single-app-wrap .ots-action-row .single_add_to_cart_button,
#ots-single-app-wrap .ots-action-row button[type="submit"].single_add_to_cart_button {
    background: #00A3E0 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 30px !important;
    /* pill shape */
    height: 48px !important;
    font-family: inherit !important;
    font-weight: 800 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: 0.3s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    /* Forces it to fill available space */
    min-width: 150px !important;
    order: 1 !important;
    /* Forces it to the right side in RTL layout */
    margin: 0 !important;
    padding: 0 30px !important;
    box-shadow: none !important;
}

#ots-single-app-wrap .ots-action-row .single_add_to_cart_button:hover,
#ots-single-app-wrap .ots-action-row button[type="submit"].single_add_to_cart_button:hover {
    background: #0089bd !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(0, 163, 224, 0.2) !important;
}

/* Payment Methods (Saudi Trusted Box) — فوق كارت التركيب */
#ots-single-app-wrap .ots-payment-methods {
    background: #FAFBFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 15px 20px !important;
    margin-top: 20px !important;
    margin-bottom: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.single_add_to_cart_button::after {
    display: none !important;
    content: none !important;
}

.ots-payment-icons {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ots-payment-icons li {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ots-payment-icons img {
    height: 28px !important;
    width: auto !important;
    object-fit: contain !important;
    mix-blend-mode: multiply !important;
    filter: contrast(1.1) !important;
}

/* Related Products Slider */
.ots-related-products-carousel {
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid var(--ots-border) !important;
}

.ots-related-products-carousel h2 {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: var(--ots-navy) !important;
    margin-bottom: 30px !important;
    text-align: right !important;
}

/* Custom Swiper Arrows */
.ots-related-products-carousel .swiper-button-next,
.ots-related-products-carousel .swiper-button-prev {
    color: var(--ots-navy) !important;
    background: #fff !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    margin-top: -20px !important;
    border: 1px solid var(--ots-border) !important;
    transition: 0.3s !important;
}

.ots-related-products-carousel .swiper-button-next:hover,
.ots-related-products-carousel .swiper-button-prev:hover {
    background: var(--ots-navy) !important;
    color: #fff !important;
}

.ots-related-products-carousel .swiper-button-next:after,
.ots-related-products-carousel .swiper-button-prev:after {
    font-size: 16px !important;
    font-weight: 900 !important;
}

/* Technical Specifications Section (Accordion) */
.ots-product-accordion {
    margin-top: 25px !important;
    background: #fff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
}

.ots-accordion-item {
    border-bottom: 1px solid #E2E8F0 !important;
}

.ots-accordion-item:last-child {
    border-bottom: none !important;
}

.ots-accordion-header {
    background: #FAFBFC !important;
    padding: 15px 20px !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: 0.3s !important;
}

.ots-accordion-title {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.ots-tab-svg {
    width: 22px !important;
    height: 22px !important;
    color: var(--ots-cyan) !important;
}

.ots-accordion-header span {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--ots-navy) !important;
}

.ots-accordion-icon {
    width: 20px !important;
    height: 20px !important;
    position: relative !important;
}

.ots-accordion-icon::before,
.ots-accordion-icon::after {
    content: "" !important;
    position: absolute !important;
    background: var(--ots-navy) !important;
    transition: 0.3s !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Horizontal line */
.ots-accordion-icon::before {
    width: 12px !important;
    height: 2px !important;
}

/* Vertical line (plus sign) */
.ots-accordion-icon::after {
    width: 2px !important;
    height: 12px !important;
}

.active .ots-accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg) !important;
    opacity: 0 !important;
}

.ots-accordion-content {
    display: none;
    /* hidden by default except if active class is preset */
    padding: 20px !important;
    background: #fff !important;
}

.ots-specs-container {
    padding: 0 !important;
}

/* Specs Grid Layout inside Accordion */
.ots-additional-list.ots-grid-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px 30px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ots-additional-list.ots-grid-layout li {
    font-size: 13px !important;
    color: #4A5568 !important;
    position: relative !important;
    padding-right: 28px !important;
    line-height: 1.6 !important;
}

.ots-additional-list.ots-grid-layout li::before {
    display: block !important;
    content: "\f147" !important;
    /* Dashicons yes/check */
    font-family: dashicons !important;
    position: absolute !important;
    right: 0 !important;
    top: -1px !important;
    color: var(--ots-cyan) !important;
    font-size: 18px !important;
}

/* Long product description: readable typography (RTL Arabic) */
/* Override .ots-premium-single-product * { text-align: right } for prose blocks */
.ots-premium-single-product .ots-description-content,
.ots-premium-single-product .ots-description-content * {
    text-align: start !important;
}

.ots-description-content {
    font-size: 15px !important;
    line-height: 1.9 !important;
    color: #4A5568 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.ots-description-content p {
    margin: 0 0 1.1em 0 !important;
    max-width: 100% !important;
}

.ots-description-content p:last-child {
    margin-bottom: 0 !important;
}

.ots-description-content h1,
.ots-description-content h2,
.ots-description-content h3,
.ots-description-content h4 {
    margin: 1.1em 0 0.6em 0 !important;
    font-weight: 800 !important;
    color: var(--ots-navy) !important;
    line-height: 1.35 !important;
}

.ots-description-content h1:first-child,
.ots-description-content h2:first-child,
.ots-description-content h3:first-child,
.ots-description-content h4:first-child {
    margin-top: 0 !important;
}

.ots-description-content ul,
.ots-description-content ol {
    margin: 0.5em 0 1em 0 !important;
    padding-right: 1.35em !important;
    padding-left: 0 !important;
}

.ots-description-content li {
    margin-bottom: 0.45em !important;
    line-height: 1.85 !important;
}

.ots-description-content li:last-child {
    margin-bottom: 0 !important;
}

.ots-description-content a {
    color: var(--ots-cyan) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
}

.ots-description-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 0.75em 0 !important;
}

/* Mobile Responsive Adjustments */
@media (max-width: 991px) {
    .ots-main-image img {
        max-width: min(100%, 400px) !important;
        max-height: min(60vh, 480px) !important;
    }

    .ots-premium-single-product {
        margin: 0 auto !important;
        padding: 10px 0 15px !important;
    }

    .ots-product-main-area {
        gap: 20px !important;
    }

    .ots-accordion-content {
        padding: 15px 10px !important;
        /* Extremely reduced padding for mobile */
    }

    .ots-additional-list.ots-grid-layout {
        grid-template-columns: 1fr !important;
        /* Back to 1 col on small mobile if needed, or 2 if space allows */
        gap: 8px !important;
    }

    .ots-description-content {
        padding: 0 5px !important;
    }
}

/* Related & Upsells */
.ots-product-bottom-area {
    margin-top: 30px !important;
}

.related.products>h2,
.up-sells>h2 {
    font-size: 24px !important;
    font-weight: 900 !important;
    color: var(--ots-navy) !important;
    margin: 50px 0 30px !important;
    border-right: 4px solid var(--ots-cyan) !important;
    padding-right: 15px !important;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .ots-product-main-area {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .ots-product-gallery-side {
        position: static !important;
    }

    .ots-single-title {
        font-size: 22px !important;
    }

    .ots-single-price {
        font-size: 20px !important;
    }

    .ots-trust-signals {
        grid-template-columns: 1fr !important;
    }

    .ots-trust-signals .signal {
        flex-direction: row !important;
        justify-content: flex-start !important;
        padding: 15px !important;
        font-size: 13px !important;
    }

    .woocommerce-tabs ul.tabs {
        flex-direction: column !important;
        border-bottom: none !important;
        gap: 5px !important;
    }

    .woocommerce-tabs ul.tabs li a {
        border-radius: 8px !important;
        border: 1px solid var(--ots-border) !important;
        bottom: 0 !important;
    }

    .woocommerce-Tabs-panel {
        border: 1px solid var(--ots-border) !important;
        border-radius: 12px !important;
        margin-top: 15px !important;
        padding: 20px !important;
    }
}