/* Local Pickup Pro Frontend Styles */

/* Pickup Information Widget */
.lpp-pickup-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.lpp-pickup-info h3 {
    font-size: 18px;
    color: #333333;
    margin: 0 0 15px 0;
    font-weight: bold;
}

.lpp-pickup-info h4 {
    font-size: 16px;
    color: #333333;
    margin: 15px 0 10px 0;
    font-weight: bold;
}

.lpp-pickup-info p,
.lpp-pickup-info div {
    font-size: 14px;
    color: #666666;
    margin: 5px 0;
    line-height: 1.5;
}

.lpp-pickup-location {
    margin-bottom: 20px;
}

.lpp-pickup-address,
.lpp-pickup-phone,
.lpp-pickup-email {
    margin: 10px 0;
}

.lpp-pickup-phone a,
.lpp-pickup-email a {
    color: #0073aa;
    text-decoration: none;
}

.lpp-pickup-phone a:hover,
.lpp-pickup-email a:hover {
    text-decoration: underline;
}

.lpp-pickup-hours {
    margin-top: 15px;
}

.lpp-pickup-hours .lpp-hours-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    margin-top: 10px;
    font-family: monospace;
    white-space: pre-line;
}

.lpp-pickup-instructions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.lpp-appointment-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 3px;
    padding: 15px;
    margin-top: 15px;
}

.lpp-appointment-info h4 {
    color: #0073aa;
    margin: 0 0 10px 0;
}

/* Pickup Options Container */
.lpp-pickup-options {
    margin: 15px 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Appointment Scheduler Styles */
.lpp-appointment-scheduler {
    margin: 15px 0;
    padding: 15px 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.lpp-appointment-scheduler h3,
.lpp-appointment-scheduler h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.lpp-location-selector,
.lpp-date-selector,
.lpp-time-selector {
    margin: 15px 0;
}

.lpp-location-selector label,
.lpp-date-selector label,
.lpp-time-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.lpp-location-select {
    width: 100%;
    max-width: 450px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.lpp-date-input,
.lpp-time-select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.lpp-location-select:focus,
.lpp-date-input:focus,
.lpp-time-select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.lpp-single-location-info {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 5px 0;
    margin: 10px 0;
}

.lpp-single-location-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.lpp-appointment-summary {
    margin-top: 15px;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.lpp-appointment-summary h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.lpp-summary-content p {
    margin: 5px 0;
    font-weight: normal;
}

.lpp-appointment-notes {
    margin: 15px 0;
}

.lpp-appointment-notes label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.lpp-appointment-notes textarea {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.lpp-appointment-notes textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.lpp-time-loading {
    padding: 10px 0;
    font-style: italic;
    color: #666;
    text-align: center;
}

.required {
    color: #e2401c;
    font-weight: bold;
}

/* Required Field Asterisk */
.lpp-required {
    color: #e2401c;
    font-weight: bold;
    margin-left: 2px;
}

/* Error Messages */
.lpp-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 3px;
    margin: 10px 0;
}

.lpp-success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #155724;
    padding: 10px 15px;
    border-radius: 3px;
    margin: 10px 0;
}

/* Loading Spinner */
.lpp-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 115, 170, 0.3);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: lpp-spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .lpp-pickup-info {
        padding: 15px;
        margin: 15px 0;
    }
    
    .lpp-appointment-scheduler {
        padding: 15px;
        margin: 15px 0;
    }
    
    .lpp-location-select,
    .lpp-date-input,
    .lpp-time-select,
    .lpp-appointment-notes textarea {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .lpp-pickup-info h3 {
        font-size: 16px;
    }
    
    .lpp-pickup-info h4 {
        font-size: 14px;
    }
    
    .lpp-appointment-scheduler h3 {
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .lpp-pickup-info {
        border: 1px solid #000;
        background: #fff;
    }
    
    .lpp-pickup-phone a,
    .lpp-pickup-email a {
        color: #000;
        text-decoration: none;
    }
    
    .lpp-appointment-scheduler {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .lpp-pickup-info {
        border: 2px solid #000;
        background: #fff;
    }
    
    .lpp-pickup-info h3,
    .lpp-pickup-info h4 {
        color: #000;
    }
    
    .lpp-pickup-info p,
    .lpp-pickup-info div {
        color: #000;
    }
}

/* Local Pickup Title */
.lpp-local-pickup-title {
    margin: 20px 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

/* Pickup Details title should inherit exact same styling as theme's Shipping Details title */
/* No debug styles or visual modifications - let theme styling handle it naturally */

/* Move Order Notes to End of Form - Enhanced for WooCommerce checkout structure */

/* Target the main checkout form structure */
.woocommerce-checkout #customer_details {
    display: flex;
    flex-direction: column;
}

/* Move additional fields (order notes) to very bottom when local pickup is active */
body.woocommerce-checkout .woocommerce-additional-fields {
    order: 999 !important;
    margin-top: 30px !important;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

/* Ensure the additional fields wrapper also follows order */
.woocommerce-checkout .woocommerce-additional-fields__field-wrapper {
    order: 999 !important;
}

/* Make sure appointment summary appears before order notes */
.lpp-appointment-summary {
    order: 998 !important;
}

/* Alternative approach - use JavaScript to physically move the element */
/* This CSS ensures proper spacing and layout when JS moves the element */
.lpp-order-notes-moved {
    margin-top: 30px !important;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

/* Ensure order notes appear after the appointment scheduler container */
#lpp-pickup-scheduler-container + .woocommerce-additional-fields,
.lpp-appointment-summary + .woocommerce-additional-fields {
    margin-top: 30px !important;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lpp-spinner {
        animation: none;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
}