/* ===== CONFIGURA TU PC - REDISEÑO PROFESIONAL ===== */
/* Tipografía: Plus Jakarta Sans | Estética: tech, limpia, profesional */

:root {
    --font-config: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Paleta: amarillo, negro, blanco */
    --ink: #000000;
    --ink-muted: #333333;
    --ink-light: #666666;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --surface-3: #f5f5f5;
    --border: #e5e5e5;
    --border-soft: #eeeeee;
    /* Acentos */
    --accent: #FFD700;
    --accent-hover: #E6C200;
    --accent-soft: rgba(255, 215, 0, 0.15);
    --success: #2d8a3e;
    --success-soft: rgba(45, 138, 62, 0.12);
    --warning: #f59e0b;
    --danger: #c0392b;
    /* Sombras y radios */
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-config);
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface);
    min-height: 100vh;
}

/* Fondo decorativo */
.configurapc-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 215, 0, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 215, 0, 0.04), transparent);
    pointer-events: none;
}

.configurapc-page {
    min-height: 100vh;
    padding: 2rem 0 1.5rem;
}

.configurapc-container,
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ----- Header (integrado en la página unificada) ----- */
.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 2rem 1.5rem 0;
}

.page-header-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-muted);
    margin-bottom: 0.5rem;
}

.page-header-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.page-header-desc {
    font-size: 1.1rem;
    color: var(--ink-muted);
    max-width: 520px;
    margin: 0 auto;
}

/* ----- Secciones (página unificada, sin cajas separadas) ----- */
.card-section {
    background: transparent;
    border-radius: 0;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
    box-shadow: none;
    border: none;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.25rem;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--ink-muted);
    margin-bottom: 1.5rem;
}

/* ----- Plataforma ----- */
.platform-selection .platform-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.platform-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    background: var(--surface);
}

.platform-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.platform-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.platform-card-inner {
    padding: 2rem 1.5rem;
    text-align: center;
}

.platform-logo-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.platform-card:hover .platform-logo {
    transform: scale(1.05);
}

.platform-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.platform-card p {
    font-size: 0.9rem;
    color: var(--ink-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.platform-card small a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.platform-card small a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ----- Configurador: barra y stepper ----- */
.configurator-header {
    margin-bottom: 2rem;
}

.progress-container {
    margin-bottom: 1.25rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #38bdf8);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-muted);
    text-align: center;
}

/* Stepper horizontal */
.stepper {
    margin-top: 1.5rem;
}

.stepper-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.25rem;
}

.stepper-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-light);
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-3);
    transition: var(--transition);
}

.stepper-num {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--border);
    color: var(--ink-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.stepper-item.current {
    color: var(--accent);
    background: var(--accent-soft);
}

.stepper-item.current .stepper-num {
    background: var(--accent);
    color: #fff;
}

.stepper-item.done .stepper-num {
    background: var(--success);
    color: #fff;
}

.stepper-item.done {
    color: var(--ink-muted);
}

/* Paso actual */
.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.25rem;
}

.step-desc {
    font-size: 1rem;
    color: var(--ink-muted);
}

/* ----- Acordeón ----- */
#components-container,
.components-container {
    margin-bottom: 2rem;
}

.components-accordion {
    margin-bottom: 1.5rem;
}

.accordion-section {
    background: var(--surface-2);
    border: none;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: var(--transition);
}

.accordion-header,
.component-section-header {
    padding: 1rem 1.25rem;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.component-section-header {
    cursor: default;
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.accordion-title h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

.component-count {
    background: var(--surface-3);
    color: var(--ink-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.selected-count {
    background: var(--success-soft);
    color: var(--success);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.accordion-content {
    padding: 1.25rem 0.75rem;
    background: var(--surface);
    overflow: visible;
}

/* ----- Carrusel ----- */
.carousel-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    width: 100%;
}

.carousel-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--radius);
}

.components-carousel {
    display: flex;
    gap: 1.25rem;
    transition: transform 0.3s ease;
    padding: 0.25rem 0;
}

.carousel-btn {
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--ink-muted);
    box-shadow: var(--shadow-sm);
}

.carousel-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.carousel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-indicator:hover,
.carousel-indicator.active {
    background: var(--accent);
    transform: scale(1.2);
}

/* ----- Tarjeta de componente ----- */
.component-card {
    min-width: 245px;
    width: 245px;
    min-height: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.component-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transition: var(--transition);
}

.component-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

.component-card:hover::before {
    transform: scaleX(1);
}

.component-card.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.component-card.selected::before {
    transform: scaleX(1);
}

/* Badge Recomendado por IA */
.component-badge-ai {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    white-space: nowrap;
}

.component-card.component-recommended {
    border-color: var(--accent);
}

.component-card.component-recommended::before {
    background: var(--accent);
}

.component-image {
    text-align: center;
    margin-bottom: 1.25rem;
    height: 140px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.component-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.component-card:hover .component-image img {
    transform: scale(1.04);
}

.component-image i {
    font-size: 3rem;
    color: var(--ink-light);
}

.component-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.component-info h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.35rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.component-info p {
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.component-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.spec-tag {
    background: var(--surface-3);
    color: var(--ink-muted);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--border-soft);
}

.spec-tag.compatibility {
    background: var(--success-soft);
    color: var(--success);
    border-color: transparent;
}

.component-price {
    margin-top: auto;
    flex-shrink: 0;
}

.component-price .price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
}

/* Check selección */
.component-card::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition);
}

.component-card.selected::after {
    content: '✓';
    opacity: 1;
    transform: scale(1);
}

/* ----- Navegación ----- */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.right-buttons {
    display: flex;
    gap: 0.75rem;
}

/* ----- Botones ----- */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-config);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 1rem 1.75rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--ink);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--ink-muted);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-muted);
}

.btn-ghost:hover {
    background: var(--surface-3);
    color: var(--ink);
}

.btn-outline {
    background: transparent;
    color: var(--ink);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #0d9668;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--accent);
    color: var(--ink);
}

.btn-info:hover {
    background: var(--accent-hover);
    color: var(--ink);
    transform: translateY(-1px);
}

/* ----- Resumen (estilo factura, minimalista) ----- */
.summary .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.summary .section-subtitle {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.summary-body {
    max-width: 640px;
    margin: 0 auto;
}

.selected-components-list {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.selected-component {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    transition: background 0.15s ease;
}

.selected-component:last-child {
    border-bottom: none;
}

.selected-component:hover {
    background: #fafafa;
}

.selected-component:hover .remove-btn {
    opacity: 1;
}

.selected-component .component-info h6 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.01em;
}

.selected-component .component-info p {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin: 0.25rem 0 0 0;
}

.selected-component .component-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selected-component .component-price span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
    min-width: 4.5rem;
    text-align: right;
}

.remove-btn {
    background: transparent;
    color: var(--ink-muted);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.75rem;
    opacity: 0.6;
}

.remove-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
    opacity: 1;
}

.summary-totals {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 280px;
    margin-left: auto;
    margin-right: 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-muted);
}

.total-row-final {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.summary-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ----- Estados: loading, error, vacío ----- */
.loading,
.error,
.no-components {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--ink-muted);
}

.loading i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: block;
    animation: spin 0.8s linear infinite;
}

.error i,
.no-components i {
    font-size: 2.5rem;
    color: var(--danger);
    margin-bottom: 1rem;
    display: block;
}

.no-components-selected {
    text-align: center;
    padding: 2rem;
    color: var(--ink-muted);
    font-size: 0.9375rem;
}

.no-components-selected i {
    font-size: 1.5rem;
    color: var(--border);
    margin-bottom: 0.5rem;
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----- Notificaciones ----- */
.notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 0.9rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform var(--transition);
    border-left: 4px solid var(--accent);
}

.notification.show {
    transform: translateX(0);
}

.notification-success { border-left-color: var(--success); }
.notification-error { border-left-color: var(--danger); }
.notification-info { border-left-color: var(--accent); }

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .configurapc-container,
    .container { padding: 0 1rem; }

    .page-header { padding: 1.5rem 1rem; margin-bottom: 1.5rem; }
    .page-header-title { font-size: 1.85rem; }
    .page-header-desc { font-size: 1rem; }

    .card-section { padding: 1.5rem 0; margin-bottom: 1.5rem; }
    .section-title { font-size: 1.35rem; }

    .stepper-name { display: none; }
    .stepper-list { gap: 0.35rem; }

    .step-title { font-size: 1.35rem; }

    .component-card {
        min-width: 260px;
        width: 260px;
        min-height: 380px;
        padding: 1.25rem;
    }

    .component-image { height: 120px; min-height: 120px; }
    .accordion-header { padding: 0.9rem 1rem; }
    .accordion-title h3 { font-size: 0.95rem; }
    .accordion-content { padding: 1rem; }

    .carousel-btn { display: none !important; }
    .components-carousel {
        overflow-x: auto !important;
        overflow-y: visible !important;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        scroll-padding: 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .components-carousel::-webkit-scrollbar { display: none; }
    .component-card { scroll-snap-align: start; }

    .navigation-buttons { flex-direction: column; gap: 0.75rem; }
    .right-buttons { width: 100%; justify-content: center; }
    .summary-totals { margin-left: 0; margin-right: 0; max-width: 100%; }
    .summary-actions { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; justify-content: center; max-width: 100%; }

    .notification { left: 1rem; right: 1rem; transform: translateY(-100px); }
    .notification.show { transform: translateY(0); }
}

@media (max-width: 480px) {
    .page-header-title { font-size: 1.6rem; }
    .platform-logo-wrap { width: 64px; height: 64px; }
    .platform-card h3 { font-size: 1.2rem; }
    .component-card {
        min-width: 240px;
        width: 240px;
        min-height: 360px;
        padding: 1rem;
    }
    .component-image { height: 100px; min-height: 100px; }
    .component-info h5 { font-size: 0.95rem; }
    .price { font-size: 1.15rem; }
}
