/**
 * Brunchy Delivery - Styles CSS
 *
 * @package Brunchy_Box
 * @since 1.3.0
 */

/* ==========================================================================
   Delivery Options Container
   ========================================================================== */

.brunchy-delivery-options {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.brunchy-delivery-options-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 15px 0;
}

/* ==========================================================================
   Delivery Type Selector
   ========================================================================== */

.brunchy-delivery-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.brunchy-delivery-type-option {
    flex: 1;
    position: relative;
}

.brunchy-delivery-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.brunchy-delivery-type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.brunchy-delivery-type-option input[type="radio"]:checked + .brunchy-delivery-type-label {
    background: #fef3e7;
    border-color: #f5a623;
}

.brunchy-delivery-type-option input[type="radio"]:focus + .brunchy-delivery-type-label {
    outline: 2px solid #f5a623;
    outline-offset: 2px;
}

.brunchy-delivery-type-label:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.brunchy-delivery-type-option input[type="radio"]:checked + .brunchy-delivery-type-label:hover {
    background: #fef3e7;
    border-color: #f5a623;
}

.brunchy-delivery-type-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.brunchy-delivery-type-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

.brunchy-delivery-type-sublabel {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* ==========================================================================
   Address Form
   ========================================================================== */

.brunchy-delivery-address-form {
    display: none;
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

.brunchy-delivery-address-form.visible {
    display: block;
}

.brunchy-delivery-form-row {
    margin-bottom: 15px;
}

.brunchy-delivery-form-row:last-child {
    margin-bottom: 0;
}

.brunchy-delivery-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.brunchy-delivery-form-label .required {
    color: #ef4444;
}

.brunchy-delivery-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.brunchy-delivery-input:focus {
    outline: none;
    border-color: #f5a623;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.brunchy-delivery-input::placeholder {
    color: #9ca3af;
}

.brunchy-delivery-input.error {
    border-color: #ef4444;
}

.brunchy-delivery-input.success {
    border-color: #10b981;
}

/* ZIP Input with Feedback */
.brunchy-delivery-zip-wrapper {
    display: flex;
    gap: 12px;
}

.brunchy-delivery-zip-wrapper .brunchy-delivery-input {
    flex: 0 0 120px;
}

/* ==========================================================================
   ZIP Validation Feedback
   ========================================================================== */

.brunchy-zip-validation-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 13px;
    min-height: 40px;
}

.brunchy-zip-validation-feedback.loading {
    color: #6b7280;
}

.brunchy-zip-validation-feedback.success {
    color: #059669;
}

.brunchy-zip-validation-feedback.error {
    color: #dc2626;
}

.brunchy-zip-validation-feedback.typing {
    color: #9ca3af;
}

.brunchy-zip-validation-feedback .feedback-text {
    line-height: 1.4;
}

/* Spinner */
.brunchy-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: brunchy-spin 0.8s linear infinite;
}

@keyframes brunchy-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Icons */
.brunchy-icon-check::before {
    content: "\2713";
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #059669;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

.brunchy-icon-error::before {
    content: "\2715";
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

/* ==========================================================================
   Delivery Info Summary
   ========================================================================== */

.brunchy-delivery-info {
    display: none;
    margin-top: 15px;
}

.brunchy-delivery-summary {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
}

.brunchy-delivery-summary > div {
    flex: 1;
    text-align: center;
}

.brunchy-delivery-summary .label {
    display: block;
    font-size: 12px;
    color: #065f46;
    margin-bottom: 4px;
}

.brunchy-delivery-summary .value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #047857;
}

/* Fee breakdown display */
.brunchy-delivery-summary .value.fee-breakdown {
    font-size: 14px;
    font-weight: 500;
}

.brunchy-delivery-summary .value.fee-breakdown .fee-label {
    font-size: 11px;
    font-weight: 400;
    color: #059669;
    text-transform: lowercase;
}

.brunchy-delivery-summary .value.fee-breakdown strong {
    font-size: 16px;
    font-weight: 700;
}

/* ==========================================================================
   Delivery Slots
   ========================================================================== */

.brunchy-delivery-slots {
    margin-top: 20px;
}

.brunchy-slots-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e5e7eb;
}

.brunchy-slots-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 12px 0;
}

.brunchy-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.brunchy-delivery-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 50px;
}

.brunchy-delivery-slot:hover:not(.disabled) {
    border-color: #f5a623;
    background: #fffbf5;
}

.brunchy-delivery-slot.selected {
    background: #fef3e7;
    border-color: #f5a623;
}

.brunchy-delivery-slot.disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.brunchy-delivery-slot .slot-time {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.brunchy-delivery-slot .slot-status {
    font-size: 11px;
    color: #ef4444;
    margin-top: 4px;
}

.brunchy-delivery-slot.selected .slot-time {
    color: #b45309;
}

.brunchy-slots-remaining {
    font-size: 12px;
    color: #6b7280;
    margin: 12px 0 0 0;
    text-align: center;
}

.brunchy-slots-notice,
.brunchy-slots-loading,
.brunchy-slots-error {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    padding: 15px;
}

.brunchy-slots-error {
    color: #dc2626;
}

/* ==========================================================================
   Add to Cart Button States
   ========================================================================== */

.brunchy-btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.brunchy-btn-reason {
    display: block;
    font-size: 12px;
    color: #dc2626;
    margin-top: 8px;
    text-align: center;
}

/* ==========================================================================
   Order/Cart Display
   ========================================================================== */

.brunchy-order-delivery-info {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    font-size: 13px;
}

.brunchy-order-delivery-info .delivery-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.brunchy-order-delivery-info .delivery-address {
    color: #6b7280;
    line-height: 1.5;
}

.brunchy-order-delivery-info .delivery-fee {
    color: #059669;
    font-weight: 500;
    margin-top: 5px;
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */

.brunchy-admin-delivery-info {
    background: #fef3e7;
    border-left: 4px solid #f5a623;
    padding: 12px 15px;
    margin: 10px 0;
}

.brunchy-admin-delivery-info h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #92400e;
}

.brunchy-admin-delivery-info p {
    margin: 5px 0;
    color: #78350f;
}

.brunchy-admin-delivery-info .fee {
    font-weight: 600;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .brunchy-delivery-type-selector {
        flex-direction: column;
    }

    .brunchy-delivery-type-label {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }

    .brunchy-delivery-type-icon {
        margin-bottom: 0;
        font-size: 20px;
    }

    .brunchy-delivery-type-text {
        text-align: left;
    }

    .brunchy-delivery-zip-wrapper {
        flex-direction: column;
    }

    .brunchy-delivery-zip-wrapper .brunchy-delivery-input {
        flex: 1;
    }

    .brunchy-delivery-summary {
        flex-direction: column;
        gap: 12px;
    }

    .brunchy-delivery-summary > div {
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .brunchy-delivery-summary .label,
    .brunchy-delivery-summary .value {
        margin: 0;
    }

    .brunchy-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .brunchy-delivery-options {
        padding: 15px;
    }

    .brunchy-delivery-address-form {
        padding: 15px;
    }

    .brunchy-slots-grid {
        grid-template-columns: 1fr;
    }
}
