/**
 * WooCommerce Oficina Correos - Checkout Styles
 */

/* Delivery Options */
.wcoc-delivery-options {
    border: 2px solid #2271b1;
    border-radius: 8px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fd 100%);
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.wcoc-delivery-options h4 {
    margin: 0 0 10px 0;
    color: #2271b1;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcoc-delivery-options p {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 14px;
}

.wcoc-delivery-type label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.wcoc-delivery-type input[type="radio"] {
    margin-right: 8px;
}

/* Address Search */
.wcoc-address-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.wcoc-address-search input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wcoc-address-search button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.wcoc-address-search button:hover {
    background: #005a87;
}

/* Offices Container */
.wcoc-offices-container h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.wcoc-offices-grid {
    display: grid;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

/* Office Items */
.wcoc-office-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.wcoc-office-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.wcoc-office-item.selected {
    border-color: #46b450;
    background: #f0f8f0;
    box-shadow: 0 2px 8px rgba(70, 180, 80, 0.2);
}

.wcoc-office-item.selected::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 15px;
    background: #46b450;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* Office Header */
.wcoc-office-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-right: 35px; /* Space for checkmark */
}

.wcoc-office-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.wcoc-distance {
    background: #0073aa;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 10px;
}

/* Office Details */
.wcoc-office-details {
    margin-bottom: 15px;
}

.wcoc-office-details p {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

.wcoc-office-details strong {
    color: #555;
    font-weight: 500;
}

/* Office Actions */
.wcoc-office-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.wcoc-office-actions .button {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #555;
    cursor: pointer;
}

.wcoc-office-actions .button.alt {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.wcoc-office-actions .button:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.wcoc-map-link {
    flex: 0 0 auto;
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
}

.wcoc-map-link:hover {
    text-decoration: underline;
}

/* Loading and Error States */
.wcoc-loading,
.wcoc-error {
    text-align: center;
    padding: 20px;
    border-radius: 4px;
}

.wcoc-loading {
    background: #f0f8ff;
    color: #0073aa;
}

.wcoc-error {
    background: #ffeaea;
    color: #dc3232;
    border: 1px solid #dc3232;
}

.wcoc-loading p,
.wcoc-error p {
    margin: 0;
    font-size: 14px;
}

/* Order Details */
.office_details {
    margin-top: 20px;
}

.office_details th {
    font-weight: 600;
    padding-right: 15px;
    vertical-align: top;
    width: 30%;
}

.office_details td {
    vertical-align: top;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wcoc-address-search {
        flex-direction: column;
    }
    
    .wcoc-address-search input[type="text"] {
        min-width: auto;
        width: 100%;
    }
    
    .wcoc-office-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-right: 15px;
    }
    
    .wcoc-distance {
        align-self: flex-start;
        margin-left: 0;
    }
    
    .wcoc-office-actions {
        flex-direction: column;
    }
    
    .wcoc-office-actions .button {
        width: 100%;
    }
}

/* WooCommerce Integration */
.woocommerce .wcoc-delivery-options {
    margin-bottom: 15px;
}

.woocommerce-checkout .wcoc-delivery-options {
    margin-top: 10px;
    margin-bottom: 0;
}

/* Animation for smooth transitions */
.wcoc-office-search {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
