/**
 * PyziTheme - Order Date Picker Styles
 * 
 * @package PyziTheme
 * @author Patryk Kowalski - KamikStudio
 */

/* =========================================
   SEKCJA DATY ODBIORU
   ========================================= */

.pyzi-order-date-section {
    background: #f9f3ed;
    border: 2px solid #ef6341;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
}

/* =========================================
   POLE DATY
   ========================================= */

.pyzi-order-date-field {
    margin-bottom: 20px;
}

.pyzi-order-date-field label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    color: #5e341c;
    margin-bottom: 10px;
}

.pyzi-date-hint {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-top: 5px;
}

.pyzi-date-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pyzi-date-input:hover {
    border-color: #ef6341;
}

.pyzi-date-input:focus {
    outline: none;
    border-color: #ef6341;
    box-shadow: 0 0 0 4px rgba(239, 99, 65, 0.1);
}

.pyzi-date-input:invalid {
    border-color: #dc3545;
}

.pyzi-date-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Błędy walidacji */
.pyzi-date-error {
    margin-top: 10px;
    padding: 10px 15px;
    background: #ffebee;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    color: #c62828;
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================
   POLE PAPILOTKI
   ========================================= */

.pyzi-papilotki-field {
    padding-top: 20px;
    border-top: 1px solid #e0d5cb;
}

.pyzi-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

.pyzi-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ef6341;
}

.pyzi-checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pyzi-checkbox-text strong {
    font-size: 15px;
    color: #5e341c;
}

.pyzi-checkbox-text small {
    font-size: 13px;
    color: #999;
}

/* =========================================
   STANY INTERAKTYWNE
   ========================================= */

/* Ukryty checkbox dla papilotki (gdy nie prostokątne) */
.pyzi-papilotki-field[style*="display: none"] {
    display: none !important;
}

/* Animacja pokazania papilotki */
.pyzi-papilotki-field {
    transition: all 0.3s ease;
    opacity: 1;
}

.pyzi-papilotki-field.pyzi-hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: none;
}

/* =========================================
   WYŚWIETLANIE W KOSZYKU
   ========================================= */

/* Meta data w koszyku */
.woocommerce-cart-form .cart-item-meta,
.order-product-meta {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.woocommerce-cart-form .cart-item-meta dt,
.order-product-meta dt {
    font-weight: 600;
    color: #5e341c;
    margin-top: 5px;
}

.woocommerce-cart-form .cart-item-meta dd,
.order-product-meta dd {
    margin: 0 0 5px 0;
}

/* Highlight dla daty odbioru */
.woocommerce-cart-form .cart-item-meta strong,
.order-product-meta strong {
    color: #ef6341;
}

/* =========================================
   CUSTOM CALENDAR ICON
   ========================================= */

/* Dodaj ikonę kalendarza do input[type="date"] */
.pyzi-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.pyzi-date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
    .pyzi-order-date-section {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .pyzi-order-date-field label {
        font-size: 15px;
    }
    
    .pyzi-date-input {
        padding: 12px 14px;
        font-size: 16px; /* Zapobiega auto-zoom na iOS */
    }
    
    .pyzi-checkbox-label {
        align-items: flex-start;
    }
    
    .pyzi-checkbox-label input[type="checkbox"] {
        flex-shrink: 0;
    }
}

/* =========================================
   LOADING STATE
   ========================================= */

.pyzi-date-input.loading {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none" stroke="%23ef6341" stroke-width="4"><animate attributeName="stroke-dasharray" dur="1.5s" repeatCount="indefinite" from="0 125" to="125 125"/><animate attributeName="stroke-dashoffset" dur="1.5s" repeatCount="indefinite" from="0" to="-125"/></circle></svg>') no-repeat right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* =========================================
   ACCESSIBILITY
   ========================================= */

.pyzi-date-input:focus-visible {
    outline: 2px solid #ef6341;
    outline-offset: 2px;
}

.pyzi-checkbox-label:focus-within {
    outline: 2px solid #ef6341;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}