/* ==============================================
   Calculateur Zone de Livraison - Styles v1.2
   ============================================== */

:root {
    --pdz-color-primary:   #e74c3c;
    --pdz-color-secondary: #3498db;
    --pdz-color-btn-text:  #ffffff;
    --pdz-title-size:      2em;
    --pdz-btn-font-size:   1em;
    --pdz-btn-radius:      8px;
    --pdz-btn-padding:     15px 30px;
}

.pizzeria-delivery-calculator {
    background: #ffffff;
    border: 2px solid var(--pdz-color-primary);
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    font-family: inherit;
}

/* ---- Header ---- */
.calculator-header { text-align: center; margin-bottom: 25px; }

.pdz-titre {
    font-size: var(--pdz-title-size);
    margin-bottom: 10px;
    color: var(--pdz-color-primary);
    line-height: 1.2;
}

.calculator-header p { font-size: 1.05em; color: #7f8c8d; margin: 0; }

/* ---- Form ---- */
.calculator-form { margin-bottom: 20px; }

.form-group { display: flex; gap: 10px; margin-bottom: 20px; }

.delivery-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.delivery-input:focus {
    outline: none;
    border-color: var(--pdz-color-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* ---- Bouton Vérifier ---- */
.delivery-button {
    padding: var(--pdz-verif-padding);
    background: var(--pdz-verif-bg);
    color: var(--pdz-verif-color);
    border: none;
    border-radius: var(--pdz-verif-radius);
    font-size: var(--pdz-verif-font-size);
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.delivery-button:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.delivery-button:active { transform: translateY(0); }

.delivery-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.delivery-button.loading::after {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 10px;
    border: 2px solid var(--pdz-verif-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: pdz-spin 0.8s linear infinite;
    vertical-align: middle;
}

/* ---- Résultats ---- */
.delivery-result {
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    animation: pdz-slide 0.3s ease;
}

@keyframes pdz-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

.delivery-result.success { background: #d4edda; border: 2px solid #28a745; color: #155724; }
.delivery-result.error   { background: #f8d7da; border: 2px solid #dc3545; color: #721c24; }
.delivery-result.info    { background: #fff3cd; border: 2px solid #ffc107; color: #856404; }

.result-icon   { font-size: 2.5em; display: block; margin-bottom: 8px; }
.result-message { font-size: 1.1em; margin-bottom: 15px; line-height: 1.6; }

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.detail-item {
    background: rgba(255,255,255,0.7);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.detail-label  { font-size: 0.85em; color: #555; display: block; margin-bottom: 4px; }
.detail-value  { font-size: 1.25em; font-weight: bold; color: #222; }

/* ---- Quartiers desservis ---- */
.pdz-quartiers {
    margin-top: 15px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
}

.pdz-quartiers-label {
    display: block;
    font-size: 0.88em;
    font-weight: bold;
    color: #444;
    margin-bottom: 8px;
}

.pdz-quartiers-list { display: flex; flex-wrap: wrap; gap: 6px; }

.pdz-quartier-tag {
    background: var(--pdz-color-primary);
    color: var(--pdz-color-btn-text);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 500;
    opacity: 0.9;
}

/* ---- Boutons CTA ---- */
.result-cta { margin-top: 18px; text-align: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.result-cta-button {
    display: inline-block;
    padding: var(--pdz-btn-padding);
    color: var(--pdz-color-btn-text);
    text-decoration: none;
    border-radius: var(--pdz-btn-radius);
    font-size: var(--pdz-btn-font-size);
    font-weight: bold;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.result-cta-button:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    color: var(--pdz-color-btn-text);
    text-decoration: none;
}

.result-cta-button.primary   { background: var(--pdz-color-primary); }
.result-cta-button.secondary { background: var(--pdz-color-secondary); }

/* ---- Footer ---- */
.calculator-footer { text-align: center; padding-top: 18px; border-top: 1px solid #eee; }
.info-text         { font-size: 0.93em; color: #7f8c8d; margin: 0; }

/* ---- Style compact ---- */
.pizzeria-delivery-calculator[data-style="compact"] { padding: 20px; max-width: 480px; }
.pizzeria-delivery-calculator[data-style="compact"] .form-group { flex-direction: column; }
.pizzeria-delivery-calculator[data-style="compact"] .delivery-button { width: 100%; }

/* ---- Style inline ---- */
.pizzeria-delivery-calculator[data-style="inline"] { background: transparent; border: none; padding: 0; box-shadow: none; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .pizzeria-delivery-calculator { padding: 18px; margin: 8px; }
    .form-group                   { flex-direction: column; }
    .delivery-button              { width: 100%; }
    .result-details               { grid-template-columns: 1fr; }
    .result-cta                   { flex-direction: column; }
    .result-cta-button            { width: 100%; text-align: center; box-sizing: border-box; }
}
