/* ============================================
   CCDSITEL — Product Catalog Page Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --navy-900: #0a0e27;
    --navy-800: #0f1535;
    --navy-700: #141c42;
    --blue-500: #2563eb;
    --blue-400: #3b82f6;
    --blue-300: #60a5fa;
    --blue-glow: rgba(37, 99, 235, 0.3);
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-glow: rgba(249, 115, 22, 0.3);
    --green-500: #22c55e;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --white: #ffffff;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.2);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- Nav --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gray-200);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy-800);
}

.logo span {
    color: var(--blue-500);
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: color var(--transition-fast);
}

.nav-back:hover {
    color: var(--blue-500);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-main);
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: var(--white);
    box-shadow: 0 0 20px var(--orange-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.4);
}

.btn-blue {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
    color: var(--white);
}

.btn-blue:hover {
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--blue-500);
    border: 2px solid var(--blue-500);
}

.btn-outline:hover {
    background: var(--blue-500);
    color: var(--white);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* --- Page Header --- */
.page-header {
    background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
    color: var(--white);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--blue-glow), transparent 70%);
}

.page-header .container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-header .breadcrumb {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.page-header .breadcrumb a {
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}

.page-header .breadcrumb a:hover {
    color: var(--white);
}

.page-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.page-header p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 650px;
}

.page-header-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* --- Products Grid --- */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* Category Controls (Search & Count) */
.category-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

.category-search {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.category-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    font-size: 1.1rem;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.category-search input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--gray-800);
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-search input::placeholder {
    color: var(--gray-400);
}

.category-search input:hover {
    border-color: var(--gray-300);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.category-search input:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 4px var(--blue-glow);
    background: #fff;
}

.category-search input:focus+.category-search-icon,
.category-search:focus-within .category-search-icon {
    opacity: 1;
    color: var(--blue-500);
}

/* Brand Filters */
.brand-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    align-items: center;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-main);
}

.filter-btn:hover {
    border-color: var(--blue-400);
    color: var(--blue-500);
    background: var(--gray-50);
}

.filter-btn.active {
    background: var(--blue-500);
    color: var(--white);
    border-color: var(--blue-500);
    box-shadow: 0 4px 12px var(--blue-glow);
}

.products-count {
    font-size: 0.9rem;
    color: var(--gray-400);
    margin-bottom: 32px;
}

.products-count strong {
    color: var(--gray-700);
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: 32px;
    transition: all var(--transition-smooth);
    display: grid;
    grid-template-columns: 300px 1fr;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-300);
    transform: translateY(-2px);
}

/* Image area */
.product-image {
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.product-image img.main-img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.product-image .placeholder-img {
    width: 120px;
    height: 120px;
    background: var(--gray-200);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--gray-300);
}

/* Gallery Thumbnails */
.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    opacity: 0.5;
}

.gallery-thumb:hover {
    opacity: 0.8;
}

.gallery-thumb.active {
    border-color: var(--blue-500);
    opacity: 1;
    box-shadow: 0 0 8px var(--blue-glow);
}

/* Gallery nav arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-600);
    transition: all var(--transition-fast);
    z-index: 3;
}

.gallery-nav:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.gallery-nav.prev {
    left: 8px;
}

.gallery-nav.next {
    right: 8px;
}

.gallery-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.7rem;
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 10px;
}

.badge-disponibilidad {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-inmediata {
    background: linear-gradient(135deg, var(--green-500), #16a34a);
    color: var(--white);
}

.badge-pedido {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: var(--white);
}

/* Info area */
.product-info {
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blue-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.product-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy-800);
    margin-bottom: 12px;
}

.product-desc {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.7;
    margin-bottom: 16px;
}

.product-features {
    margin-bottom: 20px;
}

.product-features h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.product-features ul li {
    font-size: 0.85rem;
    color: var(--gray-600);
    padding: 3px 0;
    padding-left: 20px;
    position: relative;
}

.product-features ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green-500);
    font-weight: 700;
}

.product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy-800);
}

.product-price.solicitar {
    font-size: 1rem;
    font-weight: 600;
    color: var(--orange-500);
}

.product-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- CTA Banner --- */
.cta-banner {
    background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
    color: var(--white);
    padding: 64px 0;
    text-align: center;
}

.cta-banner .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.cta-banner h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 28px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Footer small --- */
.footer-sm {
    background: var(--navy-900);
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 24px;
    font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .product-card {
        grid-template-columns: 1fr;
    }

    .product-image {
        min-height: 200px;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .product-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-name {
        font-size: 1.2rem;
    }
}

/* ============================================
   LIGHTBOX (Zoom de Imágenes)
   ============================================ */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--orange-500);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: -70px;
}

.lightbox-nav.next {
    right: -70px;
}

.lightbox-counter {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .lightbox-nav.prev {
        left: 10px;
    }

    .lightbox-nav.next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 20px;
        z-index: 10;
    }

    .lightbox-container {
        width: 100vw;
    }
}