/**
 * ShopMetro Pickup Locations - Fully Responsive
 */

/* Modal Overlay & Container */
.shopmetro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.shopmetro-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999998;
}

.shopmetro-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 40px 20px;
    overflow-y: auto;
}

.shopmetro-modal-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 900px;
    width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Modal Header */
.shopmetro-modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.shopmetro-modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.shopmetro-modal-close {
    background: #f5f5f5;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.shopmetro-modal-close:hover {
    background: #e74c3c;
    color: #fff;
}

/* Modal Filters */
.shopmetro-modal-filters {
    padding: 16px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    flex-shrink: 0;
}

.filter-region,
.filter-search {
    flex: 1;
    min-width: 180px;
}

.filter-view-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-region label,
.filter-view-toggle label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-region select,
.filter-search input {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
    height: auto;
}

.filter-region select:focus,
.filter-search input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

/* View Toggle Buttons */
.view-toggle-buttons {
    display: flex;
    gap: 5px;
}

.view-toggle-btn {
    background: #fff;
    border: 2px solid #ddd;
    padding: 9px 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    font-size: 16px;
    min-width: 42px;
}

.view-toggle-btn:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.view-toggle-btn.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* Modal Body */
.shopmetro-modal-body {
    padding: 18px 30px;
    overflow-y: auto;
    flex: 1;
    background: #f5f5f5;
    min-height: 300px;
}

.shopmetro-modal-body::-webkit-scrollbar {
    width: 8px;
}

.shopmetro-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.shopmetro-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 50px 20px;
}

.loading-spinner .spinner {
    float: none;
    margin: 0 auto 16px;
}

/* ========================================
   LIST VIEW (Clean Cards)
   ======================================== */

.stores-list.view-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stores-list.view-list .store-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    height: auto;
}

.stores-list.view-list .store-item:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

.stores-list.view-list .store-item.selected {
    background: linear-gradient(90deg, #f0f6fc 0%, #e3f2fd 100%);
    border-color: #2271b1;
    border-width: 2px;
}

.stores-list.view-list .store-item-main {
    flex: 1;
    display: grid;
    grid-template-columns: 220px 1fr auto;
    gap: 20px;
    align-items: center;
}

.stores-list.view-list .store-item-name {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stores-list.view-list .store-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.stores-list.view-list .store-region {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.stores-list.view-list .store-item-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stores-list.view-list .store-detail {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.stores-list.view-list .store-detail-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.stores-list.view-list .store-item-indicator {
    width: 26px;
    height: 26px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 0;
}

.stores-list.view-list .store-item.selected .store-item-indicator {
    background: #2ecc71;
    border-color: #2ecc71;
    color: #fff;
    font-size: 14px;
}

/* ========================================
   GRID VIEW (Cards)
   ======================================== */

.stores-list.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.stores-list.view-grid .store-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    height: auto;
}

.stores-list.view-grid .store-item:hover {
    border-color: #2271b1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stores-list.view-grid .store-item.selected {
    border-color: #2271b1;
    background: linear-gradient(135deg, #f0f6fc 0%, #e3f2fd 100%);
}

.stores-list.view-grid .store-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    padding-right: 35px;
}

.stores-list.view-grid .store-region {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.stores-list.view-grid .store-detail {
    font-size: 13px;
    color: #555;
    margin: 0 0 7px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.stores-list.view-grid .store-detail-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.stores-list.view-grid .store-hours {
    padding-top: 8px;
    border-top: 1px solid #e5e5e5;
    margin-top: 4px;
}

.stores-list.view-grid .store-item-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: #2ecc71;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.stores-list.view-grid .store-item.selected .store-item-indicator {
    display: flex;
}

/* Empty State */
.no-stores-message {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    font-size: 16px;
}

/* Modal Footer */
.shopmetro-modal-footer {
    padding: 16px 30px;
    border-top: 2px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

.footer-info {
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.shopmetro-modal-footer .button {
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    height: auto;
}

/* Selected Store Display on Checkout */
.shopmetro-selected-store {
    background: #f0f6fc;
    border: 2px solid #2271b1;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.shopmetro-selected-store h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #2271b1;
    font-weight: 700;
}

.selected-store-info .store-name {
    font-size: 16px;
    margin: 0 0 6px 0;
    font-weight: 600;
}

.selected-store-info .store-address {
    font-size: 14px;
    color: #555;
    margin: 0 0 15px 0;
}

.selected-store-info #change_pickup_location {
    background: #fff;
    border: 2px solid #2271b1;
    color: #2271b1;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    height: auto;
}

.selected-store-info #change_pickup_location:hover {
    background: #2271b1;
    color: #fff;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablets & Small Desktops (768px - 1024px) */
@media (max-width: 1024px) {
    .shopmetro-modal-container {
        max-width: 750px;
    }
    
    .stores-list.view-list .store-item-main {
        grid-template-columns: 180px 1fr auto;
        gap: 15px;
    }
    
    .stores-list.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Tablets Portrait (768px - 900px) */
@media (max-width: 900px) {
    .shopmetro-modal-wrapper {
        padding: 20px 15px;
    }
    
    .shopmetro-modal-container {
        max-height: 80vh;
    }
    
    .shopmetro-modal-filters {
        padding: 14px 20px;
    }
    
    .filter-region,
    .filter-search {
        min-width: 140px;
    }
    
    .stores-list.view-list .store-item-main {
        grid-template-columns: 160px 1fr;
        gap: 12px;
    }
    
    .stores-list.view-list .store-item-indicator {
        position: absolute;
        top: 16px;
        right: 18px;
    }
}

/* Mobile Landscape & Large Phones (600px - 767px) */
@media (max-width: 767px) {
    .shopmetro-modal-wrapper {
        padding: 15px 10px;
        align-items: flex-start;
    }
    
    .shopmetro-modal-container {
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .shopmetro-modal-header {
        padding: 16px 20px;
        border-radius: 8px 8px 0 0;
    }
    
    .shopmetro-modal-header h2 {
        font-size: 18px;
    }
    
    .shopmetro-modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .shopmetro-modal-filters {
        padding: 12px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-region,
    .filter-search,
    .filter-view-toggle {
        width: 100%;
        min-width: 100%;
    }
    
    .view-toggle-buttons {
        width: 100%;
    }
    
    .view-toggle-btn {
        flex: 1;
        padding: 10px;
    }
    
    .shopmetro-modal-body {
        padding: 14px 20px;
        min-height: 250px;
    }
    
    /* List View Mobile */
    .stores-list.view-list .store-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        padding-right: 50px;
        position: relative;
    }
    
    .stores-list.view-list .store-item-main {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stores-list.view-list .store-item-name {
        gap: 5px;
    }
    
    .stores-list.view-list .store-detail {
        font-size: 12px;
    }
    
    .stores-list.view-list .store-item-indicator {
        position: absolute;
        top: 14px;
        right: 16px;
        width: 28px;
        height: 28px;
    }
    
    /* Grid View Mobile */
    .stores-list.view-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stores-list.view-grid .store-item {
        padding: 16px;
    }
    
    .shopmetro-modal-footer {
        padding: 14px 20px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .footer-info {
        text-align: center;
        order: 2;
    }
    
    .shopmetro-modal-footer .button {
        width: 100%;
        order: 1;
        padding: 12px;
    }
}

/* Small Phones (< 480px) */
@media (max-width: 480px) {
    .shopmetro-modal-wrapper {
        padding: 10px 5px;
    }
    
    .shopmetro-modal-container {
        max-height: 95vh;
        border-radius: 6px;
    }
    
    .shopmetro-modal-header {
        padding: 14px 16px;
    }
    
    .shopmetro-modal-header h2 {
        font-size: 16px;
    }
    
    .shopmetro-modal-filters {
        padding: 10px 16px;
    }
    
    .filter-region label,
    .filter-view-toggle label {
        font-size: 11px;
    }
    
    .filter-region select,
    .filter-search input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .shopmetro-modal-body {
        padding: 12px 16px;
    }
    
    .stores-list.view-list .store-item {
        padding: 12px 14px;
        padding-right: 45px;
    }
    
    .stores-list.view-list .store-name {
        font-size: 14px;
    }
    
    .stores-list.view-list .store-region {
        font-size: 9px;
        padding: 2px 8px;
    }
    
    .stores-list.view-list .store-detail {
        font-size: 11px;
    }
    
    .stores-list.view-grid .store-item {
        padding: 14px;
    }
    
    .stores-list.view-grid .store-name {
        font-size: 15px;
    }
    
    .shopmetro-modal-footer {
        padding: 12px 16px;
    }
    
    .footer-info {
        font-size: 12px;
    }
    
    .shopmetro-modal-footer .button {
        font-size: 13px;
    }
}

/* Very Small Phones (< 360px) */
@media (max-width: 360px) {
    .shopmetro-modal-header h2 {
        font-size: 15px;
    }
    
    .stores-list.view-list .store-name {
        font-size: 13px;
    }
    
    .stores-list.view-list .store-detail {
        font-size: 11px;
    }
    
    .stores-list.view-grid .store-name {
        font-size: 14px;
    }
    
    .stores-list.view-grid .store-detail {
        font-size: 12px;
    }
}

/* Landscape Mode on Phones */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    .shopmetro-modal-wrapper {
        padding: 10px;
    }
    
    .shopmetro-modal-container {
        max-height: 92vh;
    }
    
    .shopmetro-modal-header {
        padding: 12px 20px;
    }
    
    .shopmetro-modal-filters {
        padding: 10px 20px;
        flex-direction: row;
    }
    
    .filter-region,
    .filter-search {
        min-width: 150px;
    }
    
    .shopmetro-modal-body {
        padding: 12px 20px;
    }
    
    .stores-list.view-list .store-item {
        padding: 10px 14px;
    }
}

/* ---------------------------------------------------------------
   Store Restriction Badges — shown on store cards in the modal
--------------------------------------------------------------- */
.shopmetro-store-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.shopmetro-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.shopmetro-badge-shipping {
    background: #e8f4fd;
    color: #0c5460;
    border: 1px solid #17a2b8;
}

.shopmetro-badge-payment {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #f59e0b;
}