/* 
 * TAIKA JOYERÍA - CHECKOUT STYLES
 * Archivo: static/css/checkout.css
 * Versión: 2.0
 */

/* ===================================================================
   VARIABLES
   =================================================================== */
:root {
    --primary: #1a2332;
    --primary-dark: #0f1419;
    --accent: #d4af37;
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --success: #28a745;
    --error: #a83232;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
}

/* ===================================================================
   LAYOUT PRINCIPAL
   =================================================================== */
.checkout-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 2rem;
    margin-top: 2rem;
}

/* ===================================================================
   BARRA DE PROGRESO
   =================================================================== */
.progress-bar {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    opacity: 0.4;
    transition: opacity var(--transition);
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all var(--transition);
}

.progress-step.active .step-number {
    background: var(--primary);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: var(--text);
}

/* Líneas de conexión */
.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: var(--border);
    transition: background var(--transition);
}

.progress-step.completed:not(:last-child)::after {
    background: var(--success);
}

/* ===================================================================
   FORMULARIO
   =================================================================== */
.form-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.step-content {
    display: none;
}

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

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

.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.5rem;
    color: var(--text);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* ===================================================================
   CAMPOS DE FORMULARIO
   =================================================================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--bg-card);
    color: var(--text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 50, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 0.25rem;
}

.form-input.error {
    border-color: var(--error);
}

/* ===================================================================
   BOTONES
   =================================================================== */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================================================
   OPCIONES DE ENVÍO
   =================================================================== */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shipping-option {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shipping-option:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shipping-option.selected {
    border-color: var(--primary);
    background: rgba(26, 35, 50, 0.05);
}

.shipping-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.shipping-details {
    flex: 1;
}

.shipping-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.shipping-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

.shipping-price {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

/* ===================================================================
   MÉTODOS DE PAGO
   =================================================================== */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-method {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
}

.payment-method:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-method.selected {
    border-color: var(--primary);
    background: rgba(26, 35, 50, 0.05);
}

.payment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.payment-header input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.payment-info {
    flex: 1;
}

.payment-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

.payment-details {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 6px;
    display: none;
}

.payment-method.selected .payment-details {
    display: block;
}

/* ===================================================================
   RESUMEN DEL PEDIDO (SIDEBAR)
   =================================================================== */
.order-summary {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.summary-title {
    font-size: 1.25rem;
    color: var(--text);
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-items {
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

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

.item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.item-price {
    font-size: 0.85rem;
    color: var(--text);
}

.item-total {
    font-weight: bold;
    color: var(--text);
    align-self: flex-start;
}

.summary-totals {
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.total-line:last-child {
    margin-bottom: 0;
}

.total-line.final {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 2px solid var(--border);
}

/* ===================================================================
   CHECKBOX PERSONALIZADO
   =================================================================== */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.25rem;
    cursor: pointer;
}

.checkbox-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: underline;
}

/* ===================================================================
   INFORMACIÓN DE SEGURIDAD
   =================================================================== */
.security-badges {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-main);
    border-radius: var(--radius);
    margin: 2rem 0;
}

.security-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.security-badge i {
    font-size: 1.5rem;
    color: var(--success);
}

.security-badge span {
    font-size: 0.85rem;
    color: var(--text);
}

/* ===================================================================
   LOADING Y NOTIFICACIONES
   =================================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: none;
    animation: slideIn 0.3s ease;
}

.notification.show {
    display: block;
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--error);
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 1024px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .order-summary {
        position: static;
        max-height: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .checkout-wrapper {
        padding: 1rem 0.5rem;
    }
    
    .form-card,
    .order-summary {
        padding: 1.5rem;
    }
    
    .progress-bar {
        padding: 1rem;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .btn-group {
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
    }
    
    .security-badges {
        flex-direction: column;
    }
    
    .summary-item {
        flex-wrap: wrap;
    }
    
    .item-total {
        width: 100%;
        text-align: right;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.25rem;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .notification {
        left: 10px;
        right: 10px;
    }
}
/* ====================================
   LOGOS DE CARRIERS
   ==================================== */

.carrier-logo {
    width: 100px;
    height: auto;
    max-height: 35px;
    object-fit: contain;
    margin-right: 12px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.shipping-label:hover .carrier-logo {
    transform: scale(1.05);
}

.shipping-carrier {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .carrier-logo {
        width: 80px;
        max-height: 28px;
        margin-right: 8px;
    }
    
    .shipping-carrier {
        font-size: 0.9rem;
    }
}
