/**
 * AWWP Frontend Styles
 *
 * @package AWWP_Store_Pickup_Pro
 */

/* ===========================
   Weight Selector
   =========================== */
.awwp-weight-selector {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.awwp-weight-title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Slider */
.awwp-weight-slider-wrap {
    margin-bottom: 15px;
}

.awwp-weight-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.awwp-weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
    transition: transform 0.15s;
}

.awwp-weight-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.awwp-weight-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    border: none;
}

.awwp-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Manual Input */
.awwp-weight-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.awwp-weight-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.awwp-weight-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.awwp-weight-input {
    width: 100px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
}

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

/* Preset Buttons */
.awwp-weight-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.awwp-preset-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.awwp-preset-btn:hover,
.awwp-preset-btn.active {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

/* Price Display */
.awwp-price-display {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.awwp-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.awwp-price-row:last-child {
    border-bottom: none;
    padding-top: 10px;
    margin-top: 5px;
    border-top: 2px solid #eee;
}

.awwp-price-label {
    color: #555;
    font-size: 14px;
}

.awwp-price-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.awwp-price-total .awwp-price-value {
    font-size: 18px;
    color: #7c3aed;
}

/* Warnings */
.awwp-weight-warnings {
    margin-top: 10px;
}

.awwp-weight-warnings p,
.awwp-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin: 5px 0;
}

/* Per-unit label */
.awwp-per-unit {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

/* Edit weight link in cart */
.awwp-edit-weight {
    display: block;
    font-size: 12px;
    color: #7c3aed;
    margin-top: 4px;
}

/* ===========================
   Store Pickup Checkout (Top Highlighted)
   =========================== */
.awwp-checkout-pickup-highlight {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 24px;
    margin: 0 0 30px 0;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.15);
    position: relative;
    overflow: visible;
}

.awwp-checkout-pickup-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.awwp-pickup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.awwp-pickup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #15803d;
}

.awwp-pickup-icon {
    font-size: 24px;
}

.awwp-pickup-badge {
    background: #22c55e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.awwp-pickup-subtitle {
    color: #166534;
    font-size: 14px;
    margin: 0 0 15px 0;
    opacity: 0.85;
}

.awwp-pickup-toggle {
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

.awwp-pickup-toggle label {
    font-weight: 600 !important;
    color: #15803d !important;
    font-size: 15px !important;
    cursor: pointer;
}

.awwp-pickup-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
}

#awwp-pickup-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #bbf7d0;
}

#awwp-pickup-fields label {
    font-weight: 600;
    color: #333;
}

#awwp-pickup-fields select,
#awwp-pickup-fields input[type="text"],
#awwp-pickup-fields textarea {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
}

#awwp-pickup-fields select {
    padding-right: 36px;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    text-overflow: ellipsis;
}

#awwp-pickup-fields select:focus,
#awwp-pickup-fields input:focus,
#awwp-pickup-fields textarea:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
    outline: none;
}

/* ===========================
   Pickup Status Badges
   =========================== */
.awwp-pickup-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.awwp-status-pending {
    background: #fff3cd;
    color: #856404;
}

.awwp-status-confirmed {
    background: #d1ecf1;
    color: #0c5460;
}

.awwp-status-ready {
    background: #d4edda;
    color: #155724;
}

.awwp-status-collected {
    background: #e2e3e5;
    color: #383d41;
}

.awwp-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.awwp-status-rescheduled {
    background: #e8daef;
    color: #4a235a;
}

/* ===========================
   Customer Dashboard
   =========================== */
.awwp-customer-pickups {
    margin: 20px 0;
}

.awwp-customer-pickups table {
    width: 100%;
}

.awwp-customer-pickups td small {
    display: block;
    color: #666;
    font-size: 12px;
}

/* Modal */
.awwp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.awwp-modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    position: relative;
}

.awwp-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.awwp-modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.awwp-modal-content input,
.awwp-modal-content select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* ===========================
   Order Pickup Details
   =========================== */
.awwp-order-pickup-details {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.awwp-order-pickup-details h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    /* Weight Selector */
    .awwp-weight-selector {
        padding: 15px;
    }

    .awwp-weight-presets {
        gap: 6px;
    }

    .awwp-preset-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .awwp-weight-input-wrap {
        flex-wrap: wrap;
        justify-content: center;
    }

    .awwp-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* Checkout Pickup Section */
    .awwp-checkout-pickup-highlight {
        padding: 16px;
        margin: 0 0 20px 0;
        border-radius: 8px;
    }

    .awwp-pickup-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .awwp-pickup-header h3 {
        font-size: 17px;
    }

    .awwp-pickup-icon {
        font-size: 20px;
    }

    .awwp-pickup-subtitle {
        font-size: 13px;
    }

    .awwp-pickup-toggle {
        padding: 10px 12px;
    }

    .awwp-pickup-toggle label {
        font-size: 14px !important;
    }

    #awwp-pickup-fields {
        margin-top: 15px;
        padding-top: 15px;
    }

    #awwp-pickup-fields .form-row-first,
    #awwp-pickup-fields .form-row-last {
        float: none !important;
        width: 100% !important;
        margin-bottom: 15px;
    }

    #awwp-pickup-fields select,
    #awwp-pickup-fields input[type="text"],
    #awwp-pickup-fields textarea {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 12px 36px 12px 12px !important;
        box-sizing: border-box;
        height: auto !important;
        min-height: 48px;
        line-height: 1.4;
    }

    #awwp-pickup-fields select {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: ellipsis;
        word-wrap: break-word;
    }

    #awwp-pickup-fields textarea {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: none !important;
        padding: 12px !important;
    }

    #awwp-pickup-fields .form-row {
        overflow: visible !important;
    }

    .awwp-checkout-pickup-highlight,
    #awwp-pickup-fields {
        overflow: visible !important;
    }

    #awwp-pickup-fields select option {
        white-space: normal;
        word-wrap: break-word;
        padding: 10px 8px;
        font-size: 15px;
    }

    /* Customer Dashboard */
    .awwp-customer-pickups table {
        font-size: 13px;
    }

    .awwp-customer-pickups table,
    .awwp-customer-pickups thead,
    .awwp-customer-pickups tbody,
    .awwp-customer-pickups th,
    .awwp-customer-pickups td,
    .awwp-customer-pickups tr {
        display: block;
    }

    .awwp-customer-pickups thead {
        display: none;
    }

    .awwp-customer-pickups tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 12px;
        background: #f9f9f9;
    }

    .awwp-customer-pickups td {
        padding: 6px 0;
        border: none;
        text-align: left;
    }

    .awwp-customer-pickups td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        font-size: 11px;
        color: #666;
        text-transform: uppercase;
        margin-bottom: 2px;
    }

    .awwp-customer-pickups .awwp-reschedule-btn,
    .awwp-customer-pickups .awwp-cancel-pickup-btn {
        display: inline-block;
        margin: 4px 4px 0 0;
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Modal */
    .awwp-modal {
        align-items: flex-end;
    }

    .awwp-modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 24px 20px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .awwp-modal-content input,
    .awwp-modal-content select {
        font-size: 16px;
        padding: 12px;
    }

    /* Order Pickup Details */
    .awwp-order-pickup-details {
        padding: 15px;
        margin-top: 20px;
    }

    .awwp-order-pickup-details table th,
    .awwp-order-pickup-details table td {
        display: block;
        width: 100%;
        padding: 4px 0;
    }

    .awwp-order-pickup-details table th {
        font-size: 12px;
        color: #666;
        padding-top: 10px;
    }

    .awwp-order-pickup-details table td {
        font-size: 15px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .awwp-checkout-pickup-highlight {
        padding: 14px;
    }

    .awwp-pickup-header h3 {
        font-size: 15px;
    }

    .awwp-pickup-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .awwp-preset-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .awwp-weight-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .awwp-weight-input {
        width: 80px;
        font-size: 14px;
    }
}
