/* =====================================================
   ENHANCED CHECKOUT PAGE STYLES - MODERN & ATTRACTIVE
   PinGuard - Pincode Validation Plugin
===================================================== */

/* ============================================
   MAIN CONTAINER FOR PINCODE VALIDATION
   ============================================ */

.pg-box {
    margin-top: 12px;
    font-weight: 400;
    animation: slideIn 0.3s ease;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Slide in animation for validation box */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   VALIDATION MESSAGE STYLING
   ============================================ */

.pg-box .pg-validation-message {
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Success state - Green gradient */
.pg-box .pg-validation-success {
    background: linear-gradient(135deg, #f0f9f0 0%, #e6f3e6 100%);
    border-left: 4px solid #0a8a0a;
    color: #0a8a0a;
}

/* Error state - Red gradient */
.pg-box .pg-validation-error {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe6e6 100%);
    border-left: 4px solid #a40000;
    color: #a40000;
    font-weight: 400 !important;
    margin-top: 5px;
}

/* Checking state - Gray gradient (loading) */
.pg-box .pg-validation-checking {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-left: 4px solid #999;
    color: #666;
}

/* ============================================
   CITY INFO DISPLAY
   ============================================ */

.pg-city {
    margin-top: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e4fc 100%);
    border-radius: 12px;
    color: #0D47A1;
    font-size: 13px;
    border: 1px solid rgba(13, 71, 161, 0.2);
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

/* Location pin icon before city name */
.pg-city::before {
    content: "📍";
    font-size: 16px;
}

/* ============================================
   VIEW AVAILABLE LINK
   ============================================ */

.pg-view-area {
    color: #0066FF !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    padding: 6px 12px;
    background: rgba(0, 102, 255, 0.05);
    border-radius: 20px;
    transition: all 0.2s ease;
    display: inline-block;
    margin-left: 8px;
}

.pg-view-area:hover {
    background: rgba(0, 102, 255, 0.1);
    color: #0052cc !important;
    transform: translateY(-1px);
}

/* ============================================
   PINCODES DROPDOWN CONTAINER - BASE STYLES
   ============================================ */

.pg-available-pincodes {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    animation: dropDown 0.25s ease;
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

/* Dropdown animation */
@keyframes dropDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Show when open class is added */
.pg-available-pincodes.open {
    display: flex !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 280px !important;
    margin-top: 12px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15) !important;
}

/* ============================================
   SCROLL AREA FOR PINS
   ============================================ */

.pg-pin-scroll {
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    background: #fafafa;
}

/* ============================================
   INDIVIDUAL PIN ITEMS
   ============================================ */

.pg-pin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin: 6px 0;
    font-size: 15px;
    font-weight: 500;
    background: #ffffff;
    color: #0D47A1;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid rgba(13, 71, 161, 0.15);
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* Pin item hover effect */
.pg-pin:hover {
    background: linear-gradient(135deg, #E3F0FF 0%, #d1e4ff 100%);
    border-color: #0D47A1;
    transform: translateX(2px);
    box-shadow: 0 6px 12px rgba(13, 71, 161, 0.15);
}

/* Pin city name style */
.pg-pin small {
    font-weight: normal;
    font-size: 12px;
    color: #666;
    background: rgba(0,0,0,0.03);
    padding: 4px 10px;
    border-radius: 30px;
    white-space: nowrap;
    margin-left: 10px;
}

.pg-pin:hover small {
    background: rgba(13, 71, 161, 0.1);
    color: #0D47A1;
}

/* ============================================
   TOGGLE BUTTON FOR MORE/LESS
   ============================================ */

.pg-toggle {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #a40000 0%, #b30000 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: none;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* Toggle button hover effect */
.pg-toggle:hover {
    background: linear-gradient(135deg, #b30000 0%, #c40000 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(164, 0, 0, 0.3);
}

/* Toggle button active state */
.pg-toggle:active {
    transform: translateY(0);
}

/* Hidden pins (for toggle functionality) */
.pg-pin.pg-hidden {
    display: none !important;
}

/* ============================================
   LOADING ANIMATION FOR CITY NAMES
   ============================================ */

.pg-pin small.city-name {
    background: none;
    padding: 0;
    font-style: italic;
    color: #888;
    animation: pulse 1.5s infinite;
}

/* Pulsing animation for loading state */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ============================================
   DESKTOP STYLES (≥768px)
   ============================================ */

@media (min-width: 768px) {
    .pg-box {
        width: 360px !important;
        max-width: 360px !important;
        padding: 10px !important;
    }
    
    .pg-available-pincodes.open {
        display: block !important;
        max-height: 300px !important;
    }
    
    .pg-pin-scroll {
        max-height: 280px;
        padding-bottom: 60px;
        box-sizing: border-box !important;
    }
    
    .pg-pin {
        padding: 16px 14px;
        font-size: 16px;
    }
    
    .pg-toggle {
        position: sticky;
        bottom: 0;
        height: 56px;
        line-height: 56px;
        padding: 0 !important;
        border-radius: 0;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
        box-sizing: border-box !important;
    }
}

/* ============================================
   MOBILE STYLES (≤767px)
   ============================================ */

@media (max-width: 767px) {
    
    /* Main error container */
    .pg-box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        font-size: 12px !important;  /* ✅ ERROR MESSAGE FONT SIZE */
        line-height: 1.4 !important;
    }
    
    .pg-available-pincodes.open {
        display: block !important;
        max-height: 300px !important;
    }
    
    .pg-pin-scroll {
        max-height: 280px;
        padding-bottom: 60px;
        box-sizing: border-box !important;
    }
    
    .pg-pin {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
    
    .pg-pin small {
        font-size: 11px !important;
    }
    
    .pg-toggle {
        position: sticky;
        bottom: 0;
        height: 48px;
        line-height: 48px;
        font-size: 12px !important;
        padding: 0 !important;
        border-radius: 0;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
        box-sizing: border-box !important;
    }
    
    .pg-box .pg-validation-message {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
    
    .pg-city {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    /* ✅ VIEW AVAILABLE LINK - INSIDE PG-BOX */
    .pg-box .pg-view-area {
        font-size: 11px !important;
        padding: 4px 8px !important;
        display: inline-block !important;
        margin-top: 5px !important;
    }
    /* Dropdown pincode number - direct text inside pg-pin */
    .pg-pin {
        font-size: 12px !important;
    }
    
    /* Pincode number ko aur chota karne ke liye */
    .pg-pin {
        font-size: 12px !important;
    }
    
    /* City name */
    .pg-pin small,
    .pg-pin .city-name {
        font-size: 10px !important;
    }
}

/* ============================================
   INPUT FIELD STYLING
   ============================================ */

/* Enhance the input field styling */
.pg-box + input[name="billing_postcode"],
.pg-box + input[name="shipping_postcode"] {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    transition: all 0.2s ease;
}

/* Input focus state */
.pg-box + input[name="billing_postcode"]:focus,
.pg-box + input[name="shipping_postcode"]:focus {
    border-color: #a40000;
    box-shadow: 0 0 0 3px rgba(164, 0, 0, 0.1);
    outline: none;
}

/* ============================================
   GLOBAL BOX-SIZING
   ============================================ */

.pg-box,
.pg-available-pincodes,
.pg-pin,
.pg-toggle,
.pg-pin-scroll {
    box-sizing: border-box;
}

/* Remove any extra space after plugin */
.pg-box + * {
    margin-top: 0 !important;
}