/**
 * WWDS - Kuwait Delivery & Product Installation Styles
 * Modern, responsive, ultra-clean UI for WooCommerce & WoodMart
 * Version: 2.1.0
 */

/* ----------------------------------------------------
   1. خيارات الشحن والتوصيل في صفحة إتمام الطلب (Checkout)
   ---------------------------------------------------- */
.wwds-delivery-options {
    margin-top: 10px;
    margin-bottom: 12px;
}

.wwds-delivery-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.wwds-delivery-options label:hover {
    border-color: #007cba;
    background: #f8fafc;
    transform: translateY(-1px);
}

.wwds-delivery-options input[type="radio"]:checked + span {
    font-weight: 700;
    color: #007cba;
}

.wwds-delivery-options label:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #f0f7fc;
    box-shadow: 0 3px 8px rgba(0, 124, 186, 0.12);
}

.wwds-loading {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(40%);
}

/* ----------------------------------------------------
   2. صندوق خدمة تركيب المنتج الفاخر (Product Installation Card)
   ---------------------------------------------------- */
.wwds-installation-card {
    --wwds-color: #83b735;
    --wwds-color-rgb: 131, 183, 53;
    --wwds-radius: 14px;
    position: relative;
    box-sizing: border-box;
    margin: 16px 0 20px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--wwds-radius, 14px);
    box-shadow: 0 3px 14px -3px rgba(15, 23, 42, 0.06);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.wwds-installation-card *,
.wwds-installation-card *::before,
.wwds-installation-card *::after {
    box-sizing: border-box;
}

/* تحويم الفأرة (Hover State) */
.wwds-installation-card:hover {
    border-color: var(--wwds-color);
    box-shadow: 0 8px 22px -4px rgba(15, 23, 42, 0.1);
    transform: translateY(-1.5px);
}

/* حالة التفعيل / الاختيار (Active / Checked State) */
.wwds-installation-card.wwds-is-active {
    border-color: var(--wwds-color);
    background: linear-gradient(180deg, #ffffff 0%, rgba(var(--wwds-color-rgb), 0.04) 100%);
    box-shadow: 0 10px 28px -4px rgba(var(--wwds-color-rgb), 0.22), 0 0 0 1px var(--wwds-color);
}

.wwds-card-inner {
    display: block;
    padding: 16px 18px;
    cursor: pointer;
    margin: 0;
}

/* الجزء العلوي (Control + Content + Price) */
.wwds-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* جانب زر الاختيار (Switch / Checkbox) */
.wwds-control-side {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 1. زر التبديل العصري (Modern Toggle Switch) */
.wwds-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 27px;
    cursor: pointer;
}

.wwds-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    margin: 0;
}

.wwds-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wwds-toggle-slider::before {
    position: absolute;
    content: "";
    height: 21px;
    width: 21px;
    right: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wwds-toggle-switch input:checked + .wwds-toggle-slider,
.wwds-is-active .wwds-toggle-slider {
    background-color: var(--wwds-color);
    box-shadow: 0 0 12px rgba(var(--wwds-color-rgb), 0.4);
}

.wwds-toggle-switch input:checked + .wwds-toggle-slider::before,
.wwds-is-active .wwds-toggle-slider::before {
    transform: translateX(-21px);
}

/* 2. خانة الاختيار المربعة العصرية (Modern Checkbox) */
.wwds-custom-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.wwds-custom-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    margin: 0;
}

.wwds-checkbox-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wwds-checkbox-box svg {
    width: 14px;
    height: 14px;
    stroke: #ffffff;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wwds-custom-checkbox input:checked + .wwds-checkbox-box,
.wwds-is-active .wwds-checkbox-box {
    border-color: var(--wwds-color);
    background-color: var(--wwds-color);
    box-shadow: 0 2px 8px rgba(var(--wwds-color-rgb), 0.35);
}

.wwds-custom-checkbox input:checked + .wwds-checkbox-box svg,
.wwds-is-active .wwds-checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

/* جانب المحتوى والنصوص */
.wwds-content-side {
    flex: 1 1 auto;
    min-width: 0;
}

.wwds-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 3px;
}

/* فقاعة الأيقونة */
.wwds-icon-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(var(--wwds-color-rgb), 0.1);
    color: var(--wwds-color);
    font-size: 17px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.wwds-installation-card:hover .wwds-icon-bubble,
.wwds-is-active .wwds-icon-bubble {
    transform: scale(1.08) rotate(-4deg);
}

/* عنوان الخدمة */
.wwds-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

/* الشارة الترويجية (Badge) */
.wwds-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2.5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(var(--wwds-color-rgb), 0.12);
    color: var(--wwds-color);
    line-height: 1.3;
    letter-spacing: 0.2px;
}

/* وصف الخدمة التوضيحي */
.wwds-desc {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
    margin-top: 4px;
}

/* جانب السعر */
.wwds-price-side {
    flex-shrink: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wwds-price-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 800;
    background: #f1f5f9;
    color: #1e293b;
    letter-spacing: 0.3px;
    direction: ltr;
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wwds-is-active .wwds-price-badge {
    background: var(--wwds-color);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(var(--wwds-color-rgb), 0.38);
    transform: scale(1.04);
}

.wwds-price-calc-note {
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 3px;
    white-space: nowrap;
    text-align: center;
}

/* شبكة مميزات الخدمة (Feature Bullets) */
.wwds-features-grid {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
}

.wwds-feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    line-height: 1.4;
}

.wwds-check-svg {
    width: 15px;
    height: 15px;
    color: var(--wwds-color);
    flex-shrink: 0;
}

/* ملاحظة الضمان والأمان السفلية */
.wwds-extra-note {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f8fafc;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wwds-extra-note svg {
    width: 13px;
    height: 13px;
    color: #94a3b8;
    flex-shrink: 0;
}

/* تحسين العرض والتجاوب مع شاشات الجوال */
@media (max-width: 480px) {
    .wwds-card-top {
        flex-wrap: wrap;
        gap: 10px;
    }
    .wwds-control-side {
        order: 1;
    }
    .wwds-content-side {
        order: 2;
        flex: 1 1 calc(100% - 60px);
    }
    .wwds-price-side {
        order: 3;
        width: 100%;
        align-items: flex-start;
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
        margin-top: 4px;
    }
    .wwds-features-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
