/* Huerta Pedidos - Estilos Públicos (3 Pasos) */

/* ========== CONTENEDOR PRINCIPAL ========== */
.hp-order-form-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Título y descripción */
.hp-form-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
}

.hp-form-description {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 15px;
}

/* ========== INDICADOR DE PASOS ========== */
.hp-steps-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
}

.hp-steps-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.hp-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 150px;
    position: relative;
    z-index: 1;
}

.hp-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.hp-step-label {
    font-size: 13px;
    color: #999;
    font-weight: 500;
    transition: color 0.3s ease;
}

.hp-step.active .hp-step-number {
    background: #27ae60;
    color: white;
    transform: scale(1.1);
}

.hp-step.active .hp-step-label {
    color: #27ae60;
}

.hp-step.completed .hp-step-number {
    background: #27ae60;
    color: white;
}

.hp-step.completed .hp-step-label {
    color: #27ae60;
}

/* ========== CONTENIDO DE PASOS ========== */
.hp-step-content {
    display: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    min-height: 400px;
}

.hp-step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hp-step-title {
    font-size: 22px;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #27ae60;
}

/* ========== PASO 1: PRODUCTOS ========== */
.hp-category-group {
    margin-bottom: 30px;
}

.hp-category-title {
    font-size: 18px;
    color: #34495e;
    margin-bottom: 15px;
    font-weight: 600;
}

.hp-product-type-group {
    margin-bottom: 20px;
}

.hp-product-type-title {
    font-size: 15px;
    color: #27ae60;
    margin-bottom: 10px;
    font-weight: 600;
    padding-left: 10px;
    border-left: 3px solid #27ae60;
}

.hp-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hp-product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
    gap: 10px;
}

.hp-product-row:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hp-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.hp-product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.hp-product-details {
    flex: 1;
    min-width: 0;
}

.hp-product-name {
    font-size: 15px;
    margin: 0 0 4px 0;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hp-harvest-link {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

.hp-harvest-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(39, 174, 96, 0.5);
    text-decoration: none !important;
}

.hp-harvest-link:active {
    transform: translateY(0);
}


.hp-sale-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    animation: pulse-sale 2s ease-in-out infinite;
}

@keyframes pulse-sale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hp-product-price {
    font-size: 14px;
    color: #27ae60;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.hp-regular-price {
    color: #95a5a6;
    text-decoration: line-through;
    font-size: 13px;
    font-weight: 400;
}

.hp-sale-price {
    color: #e74c3c;
    font-size: 16px;
    font-weight: 700;
}

.hp-price-unit {
    color: #7f8c8d;
    font-size: 13px;
    font-weight: 400;
}

.hp-product-quantity-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    flex-grow: 0;
    width: auto;
}

.hp-qty-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    color: #27ae60;
    font-weight: 600;
    flex-shrink: 0;
    flex-grow: 0;
    box-sizing: border-box;
}

.hp-qty-btn:hover {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.hp-qty-btn:active {
    transform: scale(0.95);
}

.hp-quantity-input {
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    padding: 6px 2px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    flex-grow: 0;
    box-sizing: border-box;
}

.hp-quantity-input:focus {
    outline: none;
    border-color: #27ae60;
}

.hp-unit-label {
    font-size: 11px;
    color: #777;
    white-space: nowrap;
    min-width: 55px;
    max-width: 55px;
    width: 55px;
    text-align: left;
    flex-shrink: 0;
    flex-grow: 0;
}

/* Resumen mini del paso 1 */
.hp-step-summary {
    margin-top: 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.hp-summary-text {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
}

.hp-items-count {
    color: #27ae60;
}

.hp-total-amount {
    font-weight: 700;
    color: #27ae60;
}

.hp-btn-next {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #27ae60;
    color: white;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.hp-btn-next:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.4);
}

.hp-btn-next:active {
    transform: translateY(0);
}

.hp-btn-next:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* ========== PASO 2: DATOS ========== */
.hp-compact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hp-form-row-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.hp-form-row-3 {
    grid-template-columns: 2fr 2fr 1fr;
}

.hp-compact-form input,
.hp-compact-form select,
.hp-compact-form textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.hp-compact-form input:focus,
.hp-compact-form select:focus,
.hp-compact-form textarea:focus {
    outline: none;
    border-color: #27ae60;
}

.hp-compact-form textarea {
    resize: vertical;
}

/* ========== PASO 3: FECHA Y HORA ========== */
.hp-delivery-picker {
    margin-bottom: 30px;
}

.hp-delivery-picker label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.hp-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.hp-date-option {
    padding: 15px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.hp-date-option:hover {
    border-color: #27ae60;
    background: #f8fff8;
}

.hp-date-option.selected {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
}

.hp-date-day {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.hp-date-number {
    font-size: 18px;
    font-weight: 700;
}

.hp-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.hp-time-option {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.hp-time-option:hover {
    border-color: #27ae60;
    background: #f8fff8;
}

.hp-time-option.selected {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
}

.hp-time-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.hp-time-slot {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hp-time-available {
    font-size: 12px;
    color: #666;
}

.hp-time-option.selected .hp-time-available {
    color: rgba(255,255,255,0.9);
}

.hp-hint {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Resumen final */
.hp-final-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.hp-final-summary h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.hp-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.hp-summary-item:last-child {
    border-bottom: none;
}

.hp-summary-total {
    font-weight: 700;
    font-size: 18px;
    color: #27ae60;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #27ae60;
}

/* GDPR compacto */
.hp-gdpr-compact {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
}

.hp-gdpr-compact label {
    display: flex;
    align-items: start;
    gap: 10px;
    cursor: pointer;
}

.hp-gdpr-compact input[type="checkbox"] {
    margin-top: 3px;
}

/* ========== NAVEGACIÓN DE PASOS ========== */
.hp-step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.hp-btn-prev,
.hp-btn-next,
.hp-btn-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hp-btn-prev {
    background: #e9ecef;
    color: #495057;
    flex: 0 0 auto;
}

.hp-btn-prev:hover {
    background: #dee2e6;
}

.hp-btn-next,
.hp-btn-submit {
    background: #27ae60;
    color: white;
    flex: 1;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.hp-btn-next:hover,
.hp-btn-submit:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.hp-btn-next:active,
.hp-btn-submit:active {
    transform: translateY(0);
}

.hp-btn-next:disabled,
.hp-btn-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* ========== PASO 4: CONFIRMACIÓN ========== */
.hp-thank-you {
    text-align: center;
    padding: 50px 30px !important;
}

.hp-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #27ae60;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.hp-success-title {
    font-size: 24px;
    color: #27ae60;
    margin-bottom: 15px;
}

.hp-success-message {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* ========== MENSAJES ========== */
.hp-form-messages {
    margin: 20px 0;
}

.hp-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.hp-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hp-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== LOADING ========== */
.hp-loading {
    text-align: center;
    padding: 30px;
    color: #999;
}

.hp-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hp-order-form-wrapper {
        padding: 15px;
    }
    
    .hp-form-title {
        font-size: 22px;
    }
    
    .hp-steps-indicator {
        margin-bottom: 25px;
    }
    
    .hp-step-label {
        font-size: 11px;
    }
    
    .hp-step-content {
        padding: 20px 15px;
    }
    
    .hp-form-row-compact {
        grid-template-columns: 1fr;
    }
    
    .hp-form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .hp-dates-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .hp-times-grid {
        grid-template-columns: 1fr;
    }
    
    .hp-step-navigation {
        flex-direction: column;
    }
    
    .hp-step-summary {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    /* Productos más compactos en móvil */
    .hp-product-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .hp-product-info {
        flex: 1 1 100%;
        min-width: 0;
    }
    
    .hp-product-quantity-compact {
        flex: 0 0 auto;
        margin-left: auto;
    }
    
    .hp-quantity-input {
        width: 40px;
        padding: 5px 2px;
        font-size: 14px;
    }
    
    .hp-qty-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .hp-unit-label {
        font-size: 10px;
        min-width: 50px;
    }
}

/* Sin productos */
.hp-no-products {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* Cuadro de advertencia de pedido mínimo */
#hp-min-order-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#hp-min-order-warning:before {
    content: "⚠️";
    font-size: 18px;
}

/* Resumen mejorado del paso 1 */
.hp-summary-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.hp-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.hp-summary-line.hp-total-line {
    padding-top: 8px;
    border-top: 2px solid #dee2e6;
    font-size: 16px;
}

.hp-summary-line.hp-delivery-line {
    color: #6c757d;
    font-size: 13px;
}

.hp-step-summary {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.hp-step-summary .hp-btn-next {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.hp-step-summary .hp-btn-next:hover {
    background: #218838;
}

.hp-step-summary .hp-btn-next:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Mensaje de error mejorado */
.hp-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hp-message.error:before {
    content: "❌";
    font-size: 18px;
}

.hp-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hp-message.success:before {
    content: "✅";
    font-size: 18px;
}
