/**
 * Delivery Options & Store Locator Styles
 *
 * @package 24hpneus
 * @since 1.2.0
 */

/* ==========================================================================
   Delivery Options (Cart & Checkout)
   ========================================================================== */

.pneus24h-delivery-options {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.pneus24h-delivery-options.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.delivery-options-title {
    margin: 0 0 15px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.delivery-info-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 6px;
    font-size: 13px;
    color: #0055a4;
}

.delivery-info-banner .icon-info {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.delivery-options-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-option {
    position: relative;
    display: block;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-option:hover {
    border-color: #999;
}

.delivery-option.active {
    border-color: var(--primary, #E63946);
    background: #fff9f9;
}

.delivery-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.delivery-option-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.delivery-option-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #f5f5f5;
    border-radius: 50%;
    color: #666;
    transition: all 0.2s ease;
}

.delivery-option.active .delivery-option-icon {
    background: var(--primary, #E63946);
    color: #fff;
}

.delivery-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.delivery-option-text strong {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.delivery-option-text small {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}

.delivery-option-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary, #E63946);
    white-space: nowrap;
}

/* Store Selection in Delivery Options */
.montage-store-selection {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.btn-select-store,
.btn-change-store {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-select-store:hover,
.btn-change-store:hover {
    border-color: var(--primary, #E63946);
    color: var(--primary, #E63946);
}

.selected-store-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
}

.selected-store-badge .store-icon {
    color: #2e7d32;
}

.selected-store-badge .store-name {
    font-weight: 600;
    color: #1a1a1a;
}

.selected-store-badge .store-city {
    color: #666;
    font-size: 13px;
}

.selected-store-badge .btn-change-store {
    margin-left: auto;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
}

/* Loading Indicator */
.delivery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    color: #666;
    font-size: 14px;
}

.delivery-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary, #E63946);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification */
.pneus24h-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 350px;
    padding: 15px 20px;
    padding-right: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.pneus24h-notification.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.pneus24h-notification--success {
    border-left: 4px solid #4caf50;
}

.pneus24h-notification--error {
    border-left: 4px solid #f44336;
}

.pneus24h-notification .notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}


/* ==========================================================================
   Store Locator Page
   ========================================================================== */

.store-locator {
    background: #f5f7fa;
    min-height: 100vh;
}

/* Header Section */
.store-locator-header {
    padding: 40px 0;
    background: linear-gradient(135deg, var(--primary, #E63946) 0%, #c41e3a 100%);
    color: #fff;
    text-align: center;
}

.store-locator-title {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
}

.store-locator-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Search Section */
.store-locator-search {
    padding: 30px 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.store-locator-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    transition: border-color 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary, #E63946);
    background: #fff;
}

.search-input-wrapper .search-icon {
    flex-shrink: 0;
    margin-left: 12px;
    color: #999;
}

.store-search-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
}

.store-search-input::placeholder {
    color: #999;
}

.btn-search {
    flex-shrink: 0;
    padding: 12px 25px;
    background: var(--primary, #E63946);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-search:hover {
    background: #c41e3a;
}

.search-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.btn-use-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--primary, #E63946);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-use-location:hover {
    opacity: 0.8;
}

/* Filters Section */
.store-locator-filters {
    padding: 15px 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.filters-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filters-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.service-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.store-service-filter {
    cursor: pointer;
}

.store-service-filter input {
    display: none;
}

.filter-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    transition: all 0.2s ease;
}

.store-service-filter input:checked + .filter-badge {
    background: var(--primary, #E63946);
    border-color: var(--primary, #E63946);
    color: #fff;
}

.filter-badge:hover {
    border-color: var(--primary, #E63946);
}

/* Loading */
.store-locator-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary, #E63946);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Main Content */
.store-locator-content {
    min-height: 600px;
}

/* Store List Panel */
.store-list-panel {
    height: 600px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #e0e0e0;
}

.store-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.store-list-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.stores-count {
    font-weight: 400;
    color: #666;
    margin-left: 5px;
}

.toggle-map-view {
    padding: 8px 15px;
    background: var(--primary, #E63946);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.store-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.store-list-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    color: #999;
}

.no-stores-found {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Store Card */
.store-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.store-card {
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-card:hover,
.store-card.is-active {
    border-color: var(--primary, #E63946);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.store-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.store-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary, #E63946);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
}

.store-name {
    flex: 1;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.store-distance {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.store-status {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.store-status--open {
    background: #e8f5e9;
    color: #2e7d32;
}

.store-status--closed {
    background: #ffebee;
    color: #c62828;
}

.store-card-body {
    margin-bottom: 10px;
}

.store-address,
.store-phone {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 13px;
    color: #666;
}

.store-address svg,
.store-phone svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #999;
}

.store-phone a {
    color: inherit;
    text-decoration: none;
}

.store-phone a:hover {
    color: var(--primary, #E63946);
}

.store-services {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.service-badge {
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
}

.service-badge.service-montage {
    background: #e3f2fd;
    color: #1565c0;
}

.service-badge.service-livraison {
    background: #fce4ec;
    color: #c2185b;
}

.store-card-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.store-card-actions .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-on-map {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #666;
}

.btn-view-on-map:hover {
    background: #eee;
}

.btn-store-directions {
    background: #fff;
    border: 1px solid var(--primary, #E63946);
    color: var(--primary, #E63946);
}

.btn-store-directions:hover {
    background: var(--primary, #E63946);
    color: #fff;
}

.btn-select-this-store {
    background: var(--primary, #E63946);
    border: none;
    color: #fff;
}

.btn-select-this-store:hover {
    background: #c41e3a;
}

/* Map Panel */
.store-map-panel {
    height: 600px;
    position: sticky;
    top: 0;
}

.store-map {
    width: 100%;
    height: 100%;
}

.map-unavailable {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    background: #f5f5f5;
    text-align: center;
    color: #666;
}

/* Info Window */
.store-info-window {
    padding: 10px;
    max-width: 250px;
}

.store-info-window h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.store-info-window p {
    margin: 0 0 8px;
    font-size: 13px;
    color: #666;
}

.store-info-window a {
    color: var(--primary, #E63946);
}

.info-window-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.info-window-actions .btn-store-directions,
.info-window-actions .btn-select-this-store {
    padding: 6px 12px;
    font-size: 12px;
}

/* Error Message */
.store-locator-error {
    position: relative;
    padding: 15px 40px 15px 20px;
    margin: 0 15px 15px;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    color: #c62828;
}

.btn-close-error {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #c62828;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Select Mode Banner */
.select-mode-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: #1a1a1a;
    color: #fff;
    text-align: center;
    z-index: 100;
}

.select-mode-banner p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
}

/* No Script Styles */
.store-locator-noscript {
    padding: 40px 0;
}

.noscript-notice {
    padding: 30px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

.noscript-store-list h3 {
    margin-bottom: 20px;
}

.noscript-store-card {
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.noscript-store-card h4 {
    margin: 0 0 10px;
    font-size: 16px;
}

.noscript-store-card address {
    font-style: normal;
    color: #666;
    margin-bottom: 10px;
}


/* ==========================================================================
   Store Single Page
   ========================================================================== */

.single-shop_store .store-detail {
    padding: 40px 0;
}

.store-detail-header {
    margin-bottom: 30px;
}

.store-detail-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
}

.store-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
}

.store-detail-map {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

.store-detail-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.store-hours-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.store-hours-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.store-hours-list li:last-child {
    border-bottom: none;
}

.store-hours-list .day {
    font-weight: 500;
}


/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 991.98px) {
    .store-locator-content .row {
        flex-direction: column-reverse;
    }

    .store-list-panel,
    .store-map-panel {
        height: auto;
        min-height: 400px;
    }

    .store-map-panel {
        display: none;
    }

    .store-locator.show-map .store-map-panel {
        display: block;
    }

    .store-locator.show-map .store-list-panel {
        display: none;
    }

    .store-list-container {
        max-height: 500px;
    }
}

@media (max-width: 767.98px) {
    .store-locator-header {
        padding: 30px 0;
    }

    .store-locator-title {
        font-size: 24px;
    }

    .delivery-option-content {
        flex-wrap: wrap;
    }

    .delivery-option-price {
        width: 100%;
        margin-top: 10px;
        text-align: right;
    }

    .selected-store-badge {
        flex-wrap: wrap;
    }

    .selected-store-badge .btn-change-store {
        width: 100%;
        margin: 10px 0 0 0;
        text-align: center;
        justify-content: center;
    }

    .search-input-wrapper {
        flex-wrap: wrap;
    }

    .btn-search {
        width: 100%;
        margin-top: 10px;
    }

    .store-card-actions {
        flex-wrap: wrap;
    }

    .store-card-actions .btn {
        flex: 1 1 calc(50% - 5px);
    }

    .btn-select-this-store {
        flex: 1 1 100% !important;
    }
}

@media (max-width: 575.98px) {
    .pneus24h-delivery-options {
        padding: 15px;
    }

    .delivery-option {
        padding: 12px 15px;
    }

    .delivery-option-icon {
        width: 40px;
        height: 40px;
    }

    .filters-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .service-filters {
        width: 100%;
    }
}
