/* =========================================================
   START – DAIVAVARNA REGISTRATION
   ========================================================= */

/* =========================================================
   PHONE + COUNTRY CODE
   Customer and vendor intentionally use the SAME layout.
   Match WoodMart's normal registration-field height.
   ========================================================= */

.dv-phone-wrapper {
    display: grid !important;
    grid-template-columns: minmax(220px, 38%) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Reset Dokan/WooCommerce widths so customer and vendor are identical. */
.dv-phone-wrapper > .dv-phone-country-code,
.dv-phone-wrapper > input[type="tel"] {
    display: block !important;
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;

    /* Use WoodMart's form height when available. */
    height: var(--wd-form-height, 42px) !important;
    min-height: var(--wd-form-height, 42px) !important;
    max-height: var(--wd-form-height, 42px) !important;

    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 999px !important;
    background-color: #fff !important;
    box-shadow: none !important;

    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    line-height: normal !important;
    vertical-align: middle !important;
}

/* Country selector: neutralize theme/Dokan select sizing and keep the label visible. */
.dv-phone-wrapper > .dv-phone-country-code {
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 0 44px 0 18px !important;
    color: #777 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #aaa 50%),
        linear-gradient(135deg, #aaa 50%, transparent 50%) !important;
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 15px) 50% !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
}

.dv-phone-wrapper > input[type="tel"] {
    padding: 0 18px !important;
    color: #333 !important;
}

.dv-phone-wrapper > .dv-phone-country-code:focus,
.dv-phone-wrapper > input[type="tel"]:focus {
    border-color: var(--wd-primary-color, #ff8b5c) !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Dokan sometimes adds its own spacing around the vendor phone input. */
.dv-vendor-phone-wrapper > *,
.dv-customer-phone-wrapper > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}


/* Keep the required star spacing aligned for both customer and vendor phone labels.
   Customer already has a literal space before the star in the PHP markup,
   so it needs a smaller offset than the vendor label. */
form.woocommerce-form-register label[for="billing_phone"] .required {
    display: inline-block !important;
    margin-left: 0 !important;
}

form.woocommerce-form-register label[for="phone"] .required,
form.woocommerce-form-register label[for="shop-phone"] .required,
form.woocommerce-form-register .dv-phone-label:not(label[for="billing_phone"]) .required {
    display: inline-block !important;
    margin-left: 4px !important;
}

/* =========================================================
   TERMS / POLICY LINKS
   ========================================================= */

.dv-registration-terms {
    margin-top: 18px;
    margin-bottom: 15px;
}

.dv-terms-label {
    display: flex;
    align-items: center;
    gap: 9px;
    line-height: 1.5;
}

.dv-terms-label input {
    margin: 0;
    flex: 0 0 auto;
}

.dv-policy-button {
    display: inline-block !important;
    padding: 6px 12px !important;
    margin: 3px 4px !important;
    border: 1px solid currentColor !important;
    border-radius: 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
}

.dv-policy-button:hover {
    opacity: .75;
}

form.woocommerce-form-register button[name="register"].dv-register-disabled {
    opacity: .45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* =========================================================
   MOBILE
   Stack country + phone, but keep exactly the same height as
   the Password / Enter Code fields instead of making them taller.
   ========================================================= */

@media (max-width: 600px) {
    .dv-phone-wrapper {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .dv-phone-wrapper > .dv-phone-country-code,
    .dv-phone-wrapper > input[type="tel"] {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: var(--wd-form-height, 42px) !important;
        min-height: var(--wd-form-height, 42px) !important;
        max-height: var(--wd-form-height, 42px) !important;
        line-height: normal !important;
        border-radius: 999px !important;
        font-size: inherit !important;
    }

    .dv-phone-wrapper > .dv-phone-country-code {
        padding: 0 44px 0 18px !important;
    }

    .dv-phone-wrapper > input[type="tel"] {
        padding: 0 18px !important;
    }
}

/* =========================================================
   END – DAIVAVARNA REGISTRATION
   ========================================================= */
