:root {
    --primary-color: #27ae60;
    --primary-dark: #219150;
    --bg-color: #f4f6f8;
    --text-color: #333;
    --border-radius: 12px;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Global Styles */
.almarva-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.almarva-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.almarva-btn:hover {
    background-color: var(--primary-dark);
}

.almarva-btn-text {
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    border-radius: var(--border-radius) !important;
    border: 1px solid transparent;
    /* Cleaner look */
    background-color: #f7f9fa;
    /* Very light grey bg */
    padding: 14px;
    /* More breathing room */
    width: 100%;
    font-size: 15px;
    color: #333;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color) !important;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}

/* Tabs - Segmented Control Style */
.almarva-tabs {
    list-style: none;
    padding: 4px;
    margin: 0 0 20px 0;
    display: flex;
    background: #f1f2f4;
    /* Light grey container */
    border-radius: var(--border-radius);
    position: relative;
    border: 1px solid #e0e0e0;
}

.almarva-tabs li {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    border-radius: 8px;
    /* Slightly smaller radius for inner items */
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    margin: 0;
}

.almarva-tabs li .icon {
    margin-right: 5px;
}

.almarva-tabs li.active {
    background: var(--white);
    color: var(--primary-color);
    /* Green text for active */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.almarva-tabs li:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Map specific tweaks */
.leaflet-container {
    border-radius: var(--border-radius);
    z-index: 10;
}

/* Dashboard & Navigation */
.almarva-sidebar ul li a {
    color: #555;
    text-decoration: none;
}

.almarva-sidebar ul li a:hover,
.almarva-sidebar ul li.is-active a {
    background-color: var(--primary-color);
    color: var(--white);
}

.almarva-sidebar ul li.is-active a .nav-icon {
    filter: brightness(0) invert(1);
}

.almarva-dashboard-wrapper {
    margin-top: 30px;
}

/* Dashboard Cards */
.almarva-dashboard-home h3 {
    margin-top: 0;
    color: var(--primary-dark);
}

.dashboard-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .almarva-checkout-wrapper {
        flex-direction: column;
    }

    .almarva-dashboard-wrapper {
        flex-direction: column;
    }

    .almarva-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* PVZ Selection & Modal */
.pvz-selection-area {
    margin-top: 15px;
}

#measoftmap_overlay {
    backdrop-filter: blur(5px);
}

.almarva-modal-content {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pvz-controls input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    margin-bottom: 15px;
}

.pvz-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background: #fff;
    max-height: calc(100vh - 200px);
    /* Fallback */
}

.pvz-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.pvz-item:hover {
    background: #f9f9f9;
}

.pvz-item.selected {
    background: #e8f5e9;
    border-left: 4px solid var(--primary-color);
}

.pvz-name {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.pvz-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.pvz-hours {
    font-size: 12px;
    color: #888;
}

button.select-pvz-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 15px;
    display: none;
    transition: background 0.2s;
}

.pvz-item:hover button.select-pvz-btn {
    display: block;
}

/* PAYMENT METHODS REDESIGN */
ul.wc_payment_methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 0 !important;
    list-style: none !important;
    margin-bottom: 20px !important;
}

li.wc_payment_method {
    background: #fff;
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-align: center;
}

li.wc_payment_method:hover {
    border-color: #aaa;
}

li.wc_payment_method input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Selected State */
li.wc_payment_method.payment_method_selected,
li.wc_payment_method input[type="radio"]:checked+label,
li.wc_payment_method input[type="radio"]:checked+span {
    /* WC JS logic or CSS Logic */
}

li.wc_payment_method.payment_method_selected {
    border-color: var(--primary-color);
    background-color: #f0fdf4;
    /* Light green tint */
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.2);
}

li.wc_payment_method label {
    display: block;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}

/* Payment Icons (if present) */
li.wc_payment_method img {
    max-height: 40px;
    margin-bottom: 5px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Payment Description Box */
.payment_box {
    grid-column: 1 / -1;
    /* Make description full width below grid */
    background: #fcfcfc;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Hide Billing - Removed to allow address entry */
/* .woocommerce-billing-fields { display: none !important; } */

.almarva-hidden-field,
#ship-to-different-address {
    display: none !important;
}

/* Almarva Checkout: Hide Logic Update */

/* 1. Hide the 'Ship to different address' checkbox container completely. 
   Since we force it to FALSE (unchecked) in PHP, hiding it prevents user from enabling it.
   Note: If PHP forces it to FALSE, it means Billing = Shipping. 
   Wait, if we want to HIDE billing fields, we usually want 'Ship to different address' to be FALSE (so billing fields are hidden by default WC JS) 
   AND we hide the toggle so they can't open it.
   Actually, WC default is: Unchecked -> Billing inputs are shown? No.
   Unchecked -> Billing inputs are HIDDEN, Shipping inputs are hidden?
   Let's clarify:
   Standard WC: 
   - 'Ship to different address' UNCHECKED -> Customer enters BILLING address. Shipping = Billing.
   - 'Ship to different address' CHECKED -> Customer enters BILLING AND SHIPPING.

   User wants: Only SHIPPING fields? 
   No, user said: 'billing maydoni avtomatik yashiriladi, agar billing va yetkazib berish bir xil deb belgilansa'
   (Billing field is automatically hidden if billing and shipping are marked as same)
   
   If WC Default:
   - Unchecked (Same): Only Billing fields are shown. (Shipping hidden).
   - Checked (Different): Billing + Shipping fields shown.
   
   If User wants ONLY Shipping fields visible:
   We should actually force 'Ship to different address' to TRUE (Checked).
   Then HIDE the Billing fields via CSS.
   
   But User said: 'shuning uchun billing maydonini bir deb belgila' -> Mark billing as one? 
   'va bu belgilashni o'zini yashirib qo'y' -> And hide this marking itself.
   
   If 'Ship to different address' is unchecked -> Billing fields are the ONLY address fields.
   If we hide them, then there are NO address fields.
   
   User wants: 'yetkazib berish manzili chiqmayapti' (Shipping address is not showing).
   
   Let's stick to the plan:
   1. Force 'Ship to different address' -> FALSE (So WC thinks Billing=Shipping).
   2. BUT we enable 'woocommerce_cart_needs_shipping_address' -> TRUE.
   
   If 'Ship to different address' is FALSE, WooCommerce usually displays the Billing Fields and uses them for everything.
   This might be confusing.
   
   Let's just apply the CSS changes requested:
   - Hide #ship-to-different-address
   - Hide My Account Billing Column
*/

#ship-to-different-address {
    display: none !important;
}

/* Hide Billing Address Column in My Account > Addresses */
.woocommerce-MyAccount-content .u-columns.woocommerce-Addresses .u-column1.woocommerce-Address,
.woocommerce-MyAccount-content .u-columns.woocommerce-Addresses .col-1.woocommerce-Address {
    display: none !important;
}

/* Make Shipping Address Column Full Width in My Account */
.woocommerce-MyAccount-content .u-columns.woocommerce-Addresses .u-column2.woocommerce-Address,
.woocommerce-MyAccount-content .u-columns.woocommerce-Addresses .col-2.woocommerce-Address {
    width: 100% !important;
    float: none !important;
}


/* Hiding Billing Fields - As requested by user */
.woocommerce-billing-fields,
.almarva-hidden-field {
    display: none !important;
}

/* Checkout jadvalidagi Shipping radio tugmalarini yashirish (Lekin narx ko'rinib turadi) */
.woocommerce-checkout-review-order-table tr.shipping input[type="radio"] {
    display: none !important;
    visibility: hidden !important;
}

/* Labelni chiroyliroq qilish (ixtiyoriy, agar radio yo'qolsa text surilib qolishi mumkin) */
.woocommerce-checkout-review-order-table tr.shipping label {
    padding-left: 0 !important;
    cursor: default;
}