/* ============================================================
   Custom Checkout Pages — Frontend Checkout Styles
   ============================================================ */

:root {
    --wccp-primary: #6c63ff;
    --wccp-btn:     #6c63ff;
    --wccp-radius:  10px;
    --wccp-shadow:  0 4px 20px rgba(0,0,0,.08);
}

/* ---- صفحه تک‌ستونه ---- */
body.wccp-checkout.wccp-layout-single-column #customer_details {
    display: block;
    max-width: 540px;
    margin: 0 auto;
}
body.wccp-checkout.wccp-layout-single-column .col2-set {
    max-width: 540px;
    margin: 0 auto;
}

/* ---- ظاهر فیلدها ---- */
body.wccp-checkout .woocommerce-billing-fields__field-wrapper .form-row input,
body.wccp-checkout .woocommerce-billing-fields__field-wrapper .form-row textarea,
body.wccp-checkout .woocommerce-billing-fields__field-wrapper .form-row select {
    border: 1.5px solid #e2e2f0;
    border-radius: var(--wccp-radius);
    padding: 12px 14px;
    font-size: 14px;
    transition: border .2s, box-shadow .2s;
    background: #fafafa;
    width: 100%;
}
body.wccp-checkout .woocommerce-billing-fields__field-wrapper .form-row input:focus,
body.wccp-checkout .woocommerce-billing-fields__field-wrapper .form-row textarea:focus {
    border-color: var(--wccp-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, .12);
    outline: none;
    background: #fff;
}

/* label */
body.wccp-checkout .woocommerce-billing-fields__field-wrapper .form-row label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

/* section title */
body.wccp-checkout h3#order_review_heading,
body.wccp-checkout h3#ship-to-different-address,
body.wccp-checkout .woocommerce-billing-fields h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e1e2e;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--wccp-primary);
    margin-bottom: 18px;
}

/* ---- دکمه پرداخت ---- */
body.wccp-checkout #place_order {
    background: var(--wccp-btn) !important;
    border: none !important;
    border-radius: var(--wccp-radius) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 14px 30px !important;
    cursor: pointer !important;
    transition: filter .2s !important;
    letter-spacing: .3px;
}
body.wccp-checkout #place_order:hover {
    filter: brightness(1.1);
}

/* ---- خلاصه سفارش ---- */
body.wccp-checkout .woocommerce-checkout-review-order table {
    border-collapse: collapse;
    width: 100%;
}
body.wccp-checkout .woocommerce-checkout-review-order .cart_item td,
body.wccp-checkout .woocommerce-checkout-review-order thead th,
body.wccp-checkout .woocommerce-checkout-review-order tfoot td,
body.wccp-checkout .woocommerce-checkout-review-order tfoot th {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
body.wccp-checkout .woocommerce-checkout-review-order tfoot .order-total th,
body.wccp-checkout .woocommerce-checkout-review-order tfoot .order-total td {
    font-size: 15px;
    font-weight: 700;
    color: var(--wccp-primary);
    border-top: 2px solid var(--wccp-primary);
}

/* ---- تاریخ تولد: picker شمسی ---- */
.wccp-birth-date-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.wccp-birth-picker {
    position: relative;
    min-width: 0;
}

.wccp-birth-picker__btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid #e2e2f0;
    border-radius: var(--wccp-radius);
    background: #fafafa;
    cursor: pointer;
    text-align: right;
    transition: border .2s, box-shadow .2s, background .2s;
    position: relative;
    font-family: inherit;
}

.wccp-birth-picker__btn:hover,
.wccp-birth-picker.is-open .wccp-birth-picker__btn {
    border-color: var(--wccp-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, .12);
}

.wccp-birth-picker__hint {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-bottom: 2px;
}

.wccp-birth-picker__val {
    font-size: 16px;
    font-weight: 700;
    color: #1e1e2e;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.wccp-birth-picker__arrow {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -5px;
    border-right: 2px solid #888;
    border-bottom: 2px solid #888;
    transform: rotate(45deg);
    transition: transform .2s;
}

.wccp-birth-picker.is-open .wccp-birth-picker__arrow {
    transform: rotate(-135deg);
    margin-top: -2px;
}

.wccp-birth-picker__panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 200;
    background: #fff;
    border: 1.5px solid #e2e2f0;
    border-radius: var(--wccp-radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
}

.wccp-birth-picker__options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wccp-birth-picker__option {
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.wccp-birth-picker__option:hover,
.wccp-birth-picker__option.is-selected {
    background: rgba(108, 99, 255, .1);
    color: var(--wccp-primary);
}

.wccp-birth-picker__options--grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.wccp-birth-picker__options--grid .wccp-birth-picker__option {
    text-align: center;
    padding: 8px 4px;
    font-size: 14px;
}

body.wccp-checkout .form-row.wccp-birth-date {
    width: 100% !important;
    float: none !important;
}

@media (max-width: 600px) {
    .wccp-birth-date-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .wccp-birth-picker__btn {
        min-height: 52px;
    }
}

/* ---- Required star ---- */
body.wccp-checkout .required,
body.wccp-checkout abbr.required {
    color: #e53e3e !important;
    text-decoration: none;
    border: 0;
    font-weight: 700;
}
body.wccp-checkout .form-row.validate-required > label::after {
    content: ' *';
    color: #e53e3e;
    font-weight: 700;
}

/* ---- Notices ---- */
body.wccp-checkout .woocommerce-error {
    border-right: 4px solid #e53e3e;
    background: #fff5f5;
    border-radius: var(--wccp-radius);
    padding: 12px 16px;
}
body.wccp-checkout .woocommerce-message {
    border-right: 4px solid var(--wccp-primary);
    background: #f3f2ff;
    border-radius: var(--wccp-radius);
    padding: 12px 16px;
}

/* ---- Inline error ---- */
.wccp-inline-error {
    display: block;
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 600;
}
body.wccp-checkout .form-row.woocommerce-invalid input,
body.wccp-checkout .form-row.woocommerce-invalid textarea {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229,62,62,.12) !important;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    body.wccp-checkout #place_order {
        width: 100% !important;
    }
}
