/* ============================================
   PERFIL DE USUARIO - ESTILOS
   ============================================ */

.profile-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.profile-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   SIDEBAR
   ============================================ */

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: white;
    padding: 35px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    z-index: 0;
}

.profile-avatar {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 4px solid white;
}

.avatar-circle i {
    font-size: 45px;
    color: var(--primary-color);
}

.avatar-badge {
    position: absolute;
    bottom: 5px;
    right: calc(50% - 50px);
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.avatar-badge i {
    color: white;
    font-size: 12px;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 5px 0;
}

.profile-email {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.profile-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-top: 20px;
    border-top: 2px solid #f3f4f6;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: #e5e7eb;
}

/* ============================================
   NAVEGACIÓN
   ============================================ */

.profile-nav {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    position: relative;
}

.profile-nav-item:hover {
    background: #f9fafb;
    color: var(--primary-color);
    padding-left: 25px;
}

.profile-nav-item.active {
    background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 10px;
    transition: all 0.3s;
}

.profile-nav-item:hover .nav-icon,
.profile-nav-item.active .nav-icon {
    background: var(--primary-color);
    color: white;
}

.nav-icon i {
    font-size: 18px;
}

.profile-nav-item span {
    flex: 1;
    font-size: 15px;
}

.nav-arrow {
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s;
}

.profile-nav-item:hover .nav-arrow,
.profile-nav-item.active .nav-arrow {
    opacity: 1;
}

.nav-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 10px 20px;
}

.logout-item {
    color: #ef4444;
}

.logout-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

.logout-item .nav-icon {
    background: #fee2e2;
    color: #ef4444;
}

.logout-item:hover .nav-icon {
    background: #ef4444;
    color: white;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.profile-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-height: 600px;
}

.profile-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.profile-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}

.section-header h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-header p {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

/* ============================================
   FORMULARIOS
   ============================================ */

.profile-form {
    max-width: 700px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 16px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #9ca3af;
    font-size: 13px;
}

.btn-save {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-add {
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* ============================================
   PEDIDOS
   ============================================ */

.orders-list {
    display: grid;
    gap: 20px;
}

.order-card {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.order-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.order-id {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.order-date {
    color: #6b7280;
    font-size: 14px;
}

.order-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-items {
    color: #6b7280;
    font-size: 14px;
}

.order-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.order-payment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #eff6ff;
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ============================================
   DIRECCIONES
   ============================================ */

.addresses-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.address-card {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
    position: relative;
}

.address-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.address-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.btn-delete {
    width: 36px;
    height: 36px;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.address-details {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .profile-container {
        grid-template-columns: 280px 1fr;
        gap: 20px;
    }
    
    .profile-content {
        padding: 30px;
    }
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.modal-header h3 {
    color: var(--text-dark);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.btn-close {
    background: #f3f4f6;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #6b7280;
}

.btn-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.modal-form {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    padding: 12px 24px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: var(--text-dark);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .profile-wrapper {
        padding: 20px 0;
    }
    
    .profile-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profile-sidebar {
        order: 2;
    }
    
    .profile-content {
        order: 1;
        padding: 25px 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .addresses-list {
        grid-template-columns: 1fr;
    }
    
    .profile-nav-item span {
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .modal-header,
    .modal-form,
    .modal-footer {
        padding: 20px;
    }
}


