
/**
 * Walker RX Drug Search - CSS
 * WPCodeBox: Add as CSS snippet, load on Frontend
 */

/* ============================================
   CSS Variables - EDIT THESE TO CUSTOMIZE
   ============================================ */
:root {
    --wrx-primary: #6B46C1;
    --wrx-primary-dark: #553C9A;
    --wrx-primary-light: #805AD5;
    --wrx-success: #059669;
    --wrx-text: #1F2937;
    --wrx-text-light: #6B7280;
    --wrx-text-muted: #9CA3AF;
    --wrx-border: #E5E7EB;
    --wrx-bg: #FFFFFF;
    --wrx-bg-light: #F9FAFB;
    --wrx-radius: 8px;
}


.walker-rx-container {
    position: relative;
}
.walker-rx-container * {
    box-sizing: border-box;
    
}

/* ============================================
   Header Section
   ============================================ */
.wrx-header {
    margin-bottom: 30px;
}

.wrx-subtitle {
    color: var(--wrx-primary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wrx-subtitle::after {
    content: '';
    display: block;
    width: 30px;
    height: 3px;
    background: var(--wrx-primary);
    border-radius: 2px;
}

.wrx-drug-title {
    font-size: 42px;
    font-weight: 300;
    color: var(--wrx-text);
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.wrx-drug-title span {
    font-weight: 600;
}

.wrx-pricing-note {
    font-size: 16px;
    color: var(--wrx-text-light);
}

.wrx-pricing-note strong {
    color: var(--wrx-text);
    font-weight: 600;
}

/* ============================================
   Search Form
   ============================================ 
.wrx-search-section {
    background: var(--wrx-bg);
    border: 1px solid var(--wrx-border);
    border-radius: var(--wrx-radius);
    padding: 24px;
    margin-bottom: 24px;
} */

.wrx-search-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.wrx-form-group {
    flex: 1;
    min-width: 200px;
}

.wrx-form-group.wrx-zip-group {
    flex: 0 0 140px;
    min-width: 140px;
}

.wrx-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.wrx-form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--wrx-border);
    border-radius: var(--wrx-radius);
    background: var(--wrx-bg);
    color: var(--wrx-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 46px;
}

.wrx-form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--wrx-primary);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.wrx-form-group input[type="text"]::placeholder {
    color: var(--wrx-text-muted);
}

.wrx-btn-search {
    padding: 0 24px;
    height: 46px;
    background: var(--wrx-primary);
    color: white;
    border: none;
    border-radius: var(--wrx-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.wrx-btn-search:hover {
    background: var(--wrx-primary-dark);
}

.wrx-btn-search:active {
    transform: scale(0.98);
}

/* ============================================
   Variant Selection (Dropdowns Row)
   ============================================ */
.wrx-variants-section {
    margin-bottom: 30px;
}

.wrx-dropdowns-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wrx-dropdown-group {
    flex: 1;
    min-width: 150px;
}

.wrx-dropdown-group.wrx-dropdown-small {
    flex: 0 0 100px;
    min-width: 100px;
}

.wrx-dropdown-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--wrx-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.wrx-select {
    width: 100%;
    padding: 0px 36px 0px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wrx-text);
    background: var(--wrx-bg);
    border: 2px solid var(--wrx-primary);
    border-radius: var(--wrx-radius);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B46C1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 42px;
}

/* ZIP input in dropdown row - no dropdown arrow */
input.wrx-select {
    background-image: none;
    padding: 10px 12px;
}

.wrx-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.15);
}

.wrx-select:hover {
    border-color: var(--wrx-primary-dark);
}

/* Reset Link */


.wrx-reset-link {
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    position: absolute;
    bottom: -30px;
   display: none;
}

.wrx-reset-link:hover i {
    transform: rotateZ(360deg);
}

.wrx-reset-link i {
    font-size: 12px;
    transition: all 0.4s ease-in-out;
}

/* ============================================
   Drug Info Bar (above results)
   ============================================ */
.wrx-drug-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #F8FAFC;
    border-left: 4px solid var(--wrx-primary);
    border-radius: 0 var(--wrx-radius) var(--wrx-radius) 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.wrx-drug-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wrx-drug-info-left i {
    color: var(--wrx-primary);
    font-size: 18px;
}

.wrx-drug-info-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--wrx-text);
}

.wrx-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wrx-badge-brand {
    background: var(--wrx-primary);
    color: white;
}

.wrx-badge-generic {
    background: #6B7280;
    color: white;
}

.wrx-drug-info-right {
    font-size: 14px;
    color: var(--wrx-text-light);
}

/* ============================================
   Location Badge
   ============================================ */
.wrx-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--wrx-primary);
    color: white;
    padding: 14px 24px;
    border-radius: var(--wrx-radius);
    font-size: 14px;
    font-weight: 600;
    height: 44px;
    margin-top: auto;
    letter-spacing: 0.5px;
}

.wrx-location-badge i {
    font-size: 16px;
}

/* ============================================
   Results Header
   ============================================ */
.wrx-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wrx-border);
    flex-wrap: wrap;
    gap: 16px;
}

.wrx-tabs {
    display: flex;
    gap: 24px;
}

.wrx-tab {
    font-size: 14px;
    font-weight: 600;
    color: var(--wrx-primary);
    padding-bottom: 4px;
    border-bottom: 3px solid var(--wrx-primary);
    cursor: pointer;
}

.wrx-results-info {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 13px;
    color: var(--wrx-text-light);
}

.wrx-results-info strong {
    color: var(--wrx-text);
}

.wrx-sort-select {
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wrx-text);
    background: transparent;
    border: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B46C1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}

/* ============================================
   Pharmacy Cards
   ============================================ */
.wrx-pharmacy-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wrx-pharmacy-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border: 1px solid var(--wrx-border);
    border-radius: var(--wrx-radius);
    margin-bottom: 12px;
    gap: 16px;
    transition: box-shadow 0.2s;
}

.wrx-pharmacy-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wrx-pharmacy-info {
    flex: 1;
    min-width: 0;
}

.wrx-pharmacy-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--wrx-text);
    margin: 0 0 4px 0;
    text-transform: uppercase;
}

.wrx-pharmacy-address {
    font-size: 13px;
    color: var(--wrx-text-light);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.wrx-pharmacy-distance,
.wrx-pharmacy-phone {
    font-size: 13px;
    color: var(--wrx-text-light);
    margin: 0 0 2px 0;
}

.wrx-pharmacy-distance i,
.wrx-pharmacy-phone i {
    margin-right: 6px;
    color: var(--wrx-text-muted);
}

.wrx-pharmacy-pricing {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.wrx-price {
    font-size: 24px;
    font-weight: 700;
    color: #059669;
}

.wrx-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    color: var(--wrx-primary);
    border: 2px solid var(--wrx-primary);
    border-radius: var(--wrx-radius);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.wrx-card-btn:hover {
    background: var(--wrx-primary);
    color: white;
}

/* ============================================
   Notice (Non-covered drugs)
   ============================================ */
.wrx-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #EBF8FF;
    border-left: 4px solid #3182CE;
    border-radius: 0 var(--wrx-radius) var(--wrx-radius) 0;
    margin-bottom: 16px;
}

.wrx-notice i {
    color: #3182CE;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.wrx-notice p {
    margin: 0;
    font-size: 14px;
    color: #2C5282;
    line-height: 1.5;
}

.wrx-notice a {
    color: #2B6CB0;
    font-weight: 600;
}

/* ============================================
   Loading Spinner
   ============================================ */
.wrx-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.wrx-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--wrx-border);
    border-top-color: var(--wrx-primary);
    border-radius: 50%;
    animation: wrx-spin 0.8s linear infinite;
}

@keyframes wrx-spin {
    to { transform: rotate(360deg); }
}

.wrx-loading-text {
    font-size: 14px;
    color: var(--wrx-text-light);
}

/* ============================================
   Error Message
   ============================================ */
.wrx-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #FEF2F2;
    border-left: 4px solid #EF4444;
    border-radius: 0 var(--wrx-radius) var(--wrx-radius) 0;
    margin-bottom: 24px;
}

.wrx-error i {
    color: #EF4444;
    font-size: 18px;
}

.wrx-error p {
    margin: 0;
    font-size: 14px;
    color: #991B1B;
}

/* ============================================
   Lightbox Modal
   ============================================ */
.wrx-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.wrx-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wrx-lightbox-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.wrx-lightbox-overlay.active .wrx-lightbox-content {
    transform: scale(1);
}

.wrx-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--wrx-border);
}

.wrx-lightbox-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--wrx-text);
    margin: 0;
}

.wrx-lightbox-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--wrx-text-light);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.wrx-lightbox-close:hover {
    color: var(--wrx-text);
}

.wrx-lightbox-body {
    padding: 0;
}

.wrx-lightbox-iframe {
    width: 100%;
    height: 500px;
    border: none;
}

/* ============================================
   Autocomplete
   ============================================ */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999 !important;
    background: white;
    border: 1px solid var(--wrx-border);
    border-radius: var(--wrx-radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 16px 16px;
    font-size: 16px;
    color: var(--wrx-text);
    cursor: pointer;
}

.ui-autocomplete .ui-menu-item-wrapper:hover,
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active {
    background: var(--wrx-bg-light);
    color: var(--wrx-primary);
}

/* ============================================
   Hidden Utility
   ============================================ */
.wrx-hidden {
    display: none !important;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .walker-rx-container {
        padding: 16px;
    }

    .wrx-drug-title {
        font-size: 28px;
    }

    .wrx-search-row {
        flex-direction: column;
    }

    .wrx-form-group,
    .wrx-form-group.wrx-zip-group {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .wrx-btn-search {
        width: 100%;
        justify-content: center;
    }

    .wrx-dropdowns-row {
        flex-direction: column;
    }

    .wrx-dropdown-group,
    .wrx-dropdown-group.wrx-dropdown-quantity {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .wrx-pharmacy-card {
        flex-wrap: wrap;
    }

    .wrx-pharmacy-info {
        flex: 1 1 calc(100% - 50px);
    }

    .wrx-pharmacy-pricing {
        flex: 1 1 100%;
        justify-content: space-between;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px dashed var(--wrx-border);
    }

    .wrx-price {
        font-size: 20px;
    }
}





/**
 * Walker RX Drug Search - CSS Additions for V2
 * Add these styles to your existing CSS
 */

/* ============================================
   Autocomplete Enhancements
   ============================================ */
.wrx-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wrx-autocomplete-source {
    font-size: 11px;
    color: #9CA3AF;
    font-style: italic;
    margin-left: 8px;
}

/* ============================================
   Best Value Badge
   ============================================ */
.wrx-best-value {
    display: inline-block;
    background: #FEF3C7;
    color: #92400E;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* ============================================
   Drug Details (per pharmacy) - Enhanced
   ============================================ */
.wrx-drug-details {
    padding: 10px 14px;
    background: #F9FAFB;
    border-radius: 6px;
    margin-right: 16px;
    min-width: 180px;
    max-width: 260px;
    border: 1px solid #E5E7EB;
}

.wrx-drug-actual-name {
    font-size: 14px;
    font-weight: 700;
    color: #1F2937;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.wrx-drug-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.wrx-drug-badge.wrx-badge-brand {
    background: var(--wrx-primary);
    color: white;
}

.wrx-drug-badge.wrx-badge-generic {
    background: #FEF3C7;         
    color: #1F2937;               
    border: 1px solid #FDE68A;    
    font-weight: 600;
    letter-spacing: 0.2px;
}

.wrx-drug-strength {
    font-size: 13px;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.wrx-drug-strength i {
    font-size: 11px;
    color: #9CA3AF;
}

.wrx-sub-warning {
    color: #F59E0B;
    font-size: 12px;
    font-weight: 700;
}

.wrx-drug-ndc-req {
    font-size: 11px;
    color: #9CA3AF;
    line-height: 1.4;
}

.wrx-drug-ndc-act {
    font-size: 11px;
    color: #9CA3AF;
    line-height: 1.4;
}

.wrx-drug-ndc-act-diff {
    font-size: 11px;
    color: #F59E0B;
    font-weight: 600;
    line-height: 1.4;
}

/* ============================================
   Info-style Error (for "no results" messages)
   ============================================ */
.wrx-error-info {
    background: #EBF8FF !important;
    border-left-color: #3182CE !important;
}

.wrx-error-info i {
    color: #3182CE !important;
}

.wrx-error-info p {
    color: #2C5282 !important;
}

/* ============================================
   Updated Pharmacy Card (with drug details)
   ============================================ */
.wrx-pharmacy-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border: 1px solid var(--wrx-border);
    border-radius: var(--wrx-radius);
    margin-bottom: 12px;
    gap: 16px;
    transition: box-shadow 0.2s;
    flex-wrap: wrap;
}

.wrx-pharmacy-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wrx-pharmacy-info {
    flex: 1;
    min-width: 200px;
}

.wrx-pharmacy-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================
   Coverage Notice Link
   ============================================ */
.wrx-card-link {
    color: #2B6CB0;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.wrx-card-link:hover {
    color: var(--wrx-primary);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .wrx-drug-details {
        flex: 1 1 100%;
        margin-right: 0;
        margin-bottom: 12px;
        max-width: 100%;
    }
    
    .wrx-pharmacy-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wrx-pharmacy-pricing {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        border-top: 1px dashed var(--wrx-border);
    }
    
    .wrx-best-value {
        order: -1;
    }
}
