/* Store Pickup Plugin Frontend Styles */

/* Store pickup location selection */
.store-pickup-locations {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    clear: both;
}

.store-pickup-locations h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    clear: both;
}

.store-pickup-location-option {
    margin-bottom: 15px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    clear: both;
    overflow: hidden;
}

.store-pickup-location-option:hover {
    border-color: #999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.store-pickup-location-option:last-child {
    margin-bottom: 0;
}

.store-pickup-location-label {
    display: block !important;
    cursor: pointer;
    margin: 0 !important;
    font-weight: normal !important;
    width: 100%;
    position: relative;
    padding: 0;
}

.store-pickup-location-option input[type="radio"] {
    margin: 0 10px 0 0 !important;
    float: left;
    clear: none;
    position: relative;
    top: 2px;
    flex-shrink: 0;
}

.store-pickup-location-content {
    margin-left: 25px;
    overflow: hidden;
    display: block;
    width: calc(100% - 25px);
}

.store-pickup-location-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
    display: block;
    clear: both;
}

.store-pickup-address {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: block;
    clear: both;
}

.store-pickup-location-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    clear: both;
}

.store-pickup-phone,
.store-pickup-hours,
.store-pickup-instructions {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
    display: block;
    clear: both;
}

.store-pickup-instructions {
    color: #888;
    font-style: italic;
    margin-bottom: 0;
}

/* Selected state */
.store-pickup-location-option input[type="radio"]:checked ~ .store-pickup-location-content .store-pickup-location-name {
    color: #0073aa;
}

.store-pickup-location-option:has(input[type="radio"]:checked) {
    border-color: #0073aa;
    background: #f0f8ff;
}

/* Fallback for browsers that don't support :has() */
.store-pickup-location-option.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.store-pickup-location-option.selected .store-pickup-location-name {
    color: #0073aa;
}

/* Focus state */
.store-pickup-location-option.focused {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Order details page */
.woocommerce-pickup-location {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    clear: both;
}

.woocommerce-pickup-location__title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.woocommerce-pickup-location address {
    font-style: normal;
    line-height: 1.6;
    margin-bottom: 15px;
}

.woocommerce-pickup-location address strong {
    font-size: 16px;
    color: #333;
}

/* Admin order meta */
.store-pickup-order-meta {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.store-pickup-order-meta h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.store-pickup-order-meta p {
    margin: 5px 0;
    line-height: 1.4;
}

/* Responsive design */
@media screen and (max-width: 768px) {
    .store-pickup-locations {
        margin: 10px 0;
        padding: 10px;
    }
    
    .store-pickup-location-option {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .store-pickup-location-content {
        margin-left: 20px;
        width: calc(100% - 20px);
    }
    
    .store-pickup-location-name {
        font-size: 15px;
    }
    
    .store-pickup-address,
    .store-pickup-phone,
    .store-pickup-hours,
    .store-pickup-instructions {
        font-size: 12px;
    }
    
    .woocommerce-pickup-location {
        padding: 15px;
        margin: 15px 0;
    }
    
    .woocommerce-pickup-location__title {
        font-size: 16px;
    }
}

/* Loading state */
.store-pickup-locations.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.store-pickup-locations.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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

/* Error states */
.store-pickup-error {
    color: #dc3232;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #ffeaea;
    border: 1px solid #dc3232;
    border-radius: 4px;
    clear: both;
}

/* Success states */
.store-pickup-success {
    color: #46b450;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0f8f0;
    border: 1px solid #46b450;
    border-radius: 4px;
    clear: both;
}

/* Fix for theme conflicts */
.store-pickup-locations * {
    box-sizing: border-box;
}

.store-pickup-location-option label {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.store-pickup-location-option input[type="radio"] {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
    top: 2px !important;
    margin: 0 10px 0 0 !important;
    width: auto !important;
    height: auto !important;
}

/* Ensure proper text wrapping */
.store-pickup-location-content * {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Clear floats */
.store-pickup-locations::after,
.store-pickup-location-option::after,
.store-pickup-location-content::after {
    content: "";
    display: table;
    clear: both;
}

