/* ==========================================================================
   Teknobyte - Catálogo Moderno
   ========================================================================== */

/* --------------------------------------------------------------------------
   Catalog Hero
   -------------------------------------------------------------------------- */
.catalog-hero {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    padding: 6.5rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: visible;
    z-index: 2;
}

.catalog-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(52, 211, 153, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.catalog-hero .container { position: relative; z-index: 1; }

.catalog-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.catalog-hero-title i { color: #34d399; margin-right: 0.5rem; }

.catalog-hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.hero-search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-search-input {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 0 1rem;
    gap: 0.5rem;
}

.hero-search-input i { color: #adb5bd; font-size: 0.9rem; }

.hero-search-input input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.85rem 0.5rem;
    font-size: 0.95rem;
    background: transparent;
}

.hero-search-clear {
    color: #adb5bd;
    text-decoration: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.hero-search-clear:hover { color: #6c757d; }

.hero-search-btn {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    border: none;
    padding: 0.85rem 1.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.hero-search-btn:hover { opacity: 0.9; }

/* --------------------------------------------------------------------------
   Live Search Dropdown
   -------------------------------------------------------------------------- */
.catalog-hero-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    z-index: 9001;
}

.live-search-results {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    max-height: 420px;
    overflow-y: auto;
    z-index: 9000;
    scrollbar-width: thin;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: #212529;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.live-search-item:hover,
.live-search-item.highlighted { background: #f0fdf4; }

.live-search-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.live-search-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ced4da;
    font-size: 0.9rem;
}

.live-search-info { flex: 1; min-width: 0; }

.live-search-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-search-meta {
    display: block;
    font-size: 0.72rem;
    color: #6c757d;
    margin-top: 0.1rem;
}

.live-search-viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #059669;
    text-decoration: none;
    transition: background 0.15s;
}

.live-search-viewall:hover,
.live-search-viewall.highlighted { background: #f0fdf4; }

.live-search-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
}

/* --------------------------------------------------------------------------
   Categories Bar — Dropdown Navigation
   -------------------------------------------------------------------------- */
.catalog-categories-bar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
    position: sticky;
    top: 80px;
    z-index: 51;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: visible;
}

.categories-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
}

.cat-main-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 1.1rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.cat-main-btn:hover { color: #047857; background: #f0fdf4; }

.cat-main-btn.active {
    color: #047857;
    border-bottom-color: #059669;
    font-weight: 600;
    background: #f0fdf4;
}

.cat-main-btn i:first-child { font-size: 0.85rem; color: #6c757d; }
.cat-main-btn.active i:first-child,
.cat-main-btn:hover i:first-child { color: #059669; }

.cat-count {
    background: #e9ecef;
    color: #6c757d;
    padding: 0.1rem 0.45rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
}

.cat-main-btn.active .cat-count { background: #d1fae5; color: #047857; }

.cat-arrow {
    font-size: 0.55rem !important;
    margin-left: 0.15rem;
    transition: transform 0.2s;
    color: #adb5bd !important;
    cursor: pointer;
    padding: 0.3rem;
}

.cat-dropdown { position: relative; }

.cat-dropdown.active > .cat-main-btn { color: #047857; background: #f0fdf4; }
.cat-dropdown.active > .cat-main-btn i:first-child { color: #059669; }

.cat-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e9ecef;
    border-top: 2px solid #059669;
    z-index: 200;
    padding: 0.35rem 0;
    animation: fadeDropdown 0.15s ease;
}

@keyframes fadeDropdown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.cat-dropdown:hover > .cat-submenu { display: block; }
.cat-dropdown:hover > .cat-main-btn .cat-arrow { transform: rotate(180deg); }
.cat-dropdown.open > .cat-submenu { display: block; }
.cat-dropdown.open > .cat-main-btn .cat-arrow { transform: rotate(180deg); }

.cat-sub-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.15s;
    white-space: nowrap;
}

.cat-sub-item:hover { background: #f0fdf4; color: #047857; }

.cat-sub-item.active {
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

.cat-sub-item i { font-size: 0.75rem; color: #6c757d; width: 18px; text-align: center; }
.cat-sub-item:hover i,
.cat-sub-item.active i { color: #059669; }

.cat-sub-item small {
    margin-left: auto;
    background: #f1f3f5;
    color: #6c757d;
    padding: 0.1rem 0.4rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
}

.cat-sub-item.active small { background: #d1fae5; color: #047857; }

/* --------------------------------------------------------------------------
   Catalog Section
   -------------------------------------------------------------------------- */
.catalog-section {
    padding: 2rem 0 3rem;
    background: #f8f9fa;
    min-height: 60vh;
}

.catalog-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-info p { color: #6c757d; font-size: 0.9rem; margin: 0; }
.results-info strong { color: #212529; }

.results-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-sort label { color: #6c757d; font-size: 0.85rem; }

.results-sort select {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: #495057;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.results-sort select:focus { border-color: #059669; }

/* --------------------------------------------------------------------------
   Products Grid
   -------------------------------------------------------------------------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* --------------------------------------------------------------------------
   Product Card
   -------------------------------------------------------------------------- */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: #059669;
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
}

.product-card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img { transform: scale(1.05); }

.product-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    color: #ced4da;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-oferta { left: 0.75rem; background: #e63946; color: #fff; }

.badge-destacado {
    right: 0.75rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.product-card-body {
    padding: 1rem 1rem 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #059669;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.product-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.35;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-card-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.price-original {
    font-size: 0.8rem;
    color: #adb5bd;
    text-decoration: line-through;
}

.price-current {
    font-size: 1.15rem;
    font-weight: 700;
    color: #047857;
}

.product-card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.product-card-action {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    transition: color 0.2s;
}

.product-card:hover .product-card-action { color: #059669; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.catalog-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.catalog-pagination-list {
    display: flex;
    list-style: none;
    gap: 0.35rem;
    margin: 0; padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.catalog-pagination .page-item,
.catalog-pagination-list .page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; height: 40px;
    padding: 0 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    cursor: pointer;
}

.page-item.active {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    cursor: default;
}

.page-item.disabled {
    color: #ced4da;
    cursor: not-allowed;
    opacity: 0.6;
}

a.page-item:hover {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.catalog-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.catalog-empty i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
    display: block;
}

.catalog-empty h3 { font-size: 1.25rem; color: #495057; margin-bottom: 0.5rem; }
.catalog-empty p { color: #6c757d; margin-bottom: 1.5rem; }

.catalog-empty .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.catalog-empty .btn-primary:hover { opacity: 0.9; }

/* --------------------------------------------------------------------------
   Product Detail - Breadcrumb
   -------------------------------------------------------------------------- */
.product-breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #6c757d;
    flex-wrap: wrap;
}

.breadcrumb-nav a { color: #6c757d; text-decoration: none; transition: color 0.2s; }
.breadcrumb-nav a:hover { color: #059669; }
.breadcrumb-nav .fa-chevron-right { font-size: 0.55rem; color: #adb5bd; }
.breadcrumb-nav span { color: #212529; font-weight: 500; }

/* --------------------------------------------------------------------------
   Product Detail - Layout
   -------------------------------------------------------------------------- */
.product-detail-section {
    padding: 2rem 0 3rem;
    background: #fff;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.product-image-main {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1;
    border: 1px solid #e9ecef;
}

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

.product-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%; height: 100%;
    color: #ced4da;
}

.product-image-placeholder i { font-size: 4rem; }
.product-image-placeholder span { font-size: 0.9rem; }

.product-image-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.thumb-btn {
    width: 60px; height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color 0.2s;
}

.thumb-btn.active,
.thumb-btn:hover { border-color: #059669; }

.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }

.product-detail-category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #059669;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.product-detail-category:hover { color: #047857; }

.product-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.product-detail-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.product-detail-price-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.price-offer-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #e63946;
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.price-original-lg {
    display: block;
    font-size: 1rem;
    color: #adb5bd;
    text-decoration: line-through;
    margin-bottom: 0.15rem;
}

.price-current-lg {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #047857;
}

.product-detail-description { margin-bottom: 1.25rem; }
.product-detail-description p { font-size: 0.92rem; color: #495057; line-height: 1.6; }

.product-detail-specs { margin-bottom: 1.25rem; }

.product-detail-specs h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.specs-table { width: 100%; border-collapse: collapse; }
.specs-table tr:nth-child(even) { background: #f8f9fa; }

.specs-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #f0f0f0;
}

.spec-key { color: #6c757d; font-weight: 500; width: 40%; }
.spec-value { color: #212529; }

.product-detail-availability { margin-bottom: 1.25rem; }

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.availability-badge.available {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.product-detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.btn-whatsapp:hover {
    background: #1da851;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: #fff;
    color: #495057;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.btn-contact:hover { background: #f8f9fa; border-color: #adb5bd; }

.product-detail-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.product-detail-share span { font-size: 0.82rem; color: #6c757d; }

.share-btn {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.share-facebook { background: #e8f4fd; color: #1877f2; }
.share-facebook:hover { background: #1877f2; color: #fff; }
.share-whatsapp { background: #d1fae5; color: #25d366; }
.share-whatsapp:hover { background: #25d366; color: #fff; }
.share-copy { background: #f3f4f6; color: #6c757d; }
.share-copy:hover { background: #6c757d; color: #fff; }

.product-detail-full {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.product-detail-full h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-content { font-size: 0.92rem; color: #495057; line-height: 1.7; }

/* --------------------------------------------------------------------------
   Related Products
   -------------------------------------------------------------------------- */
.related-products-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.related-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-title i { color: #059669; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .product-detail-grid { grid-template-columns: 1fr; gap: 2rem; }
    .cat-submenu { min-width: 220px; }
}

@media (max-width: 768px) {
    .catalog-hero { padding: 5.5rem 0 2rem; }
    .catalog-hero-title { font-size: 1.5rem; }
    .hero-search-form { flex-direction: column; border-radius: 12px; }
    .hero-search-input { border-radius: 12px 12px 0 0; }
    .hero-search-btn { border-radius: 0 0 12px 12px; padding: 0.75rem; }
    .catalog-categories-bar { top: 60px; }
    .categories-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .cat-main-btn { padding: 0.7rem 0.85rem; font-size: 0.78rem; }
    .cat-submenu { min-width: 200px; position: fixed; top: auto; left: auto; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .product-card-body { padding: 0.75rem 0.75rem 0.5rem; }
    .product-card-title { font-size: 0.78rem; }
    .price-current { font-size: 1rem; }
    .product-card-footer { padding: 0.5rem 0.75rem; }
    .product-detail-title { font-size: 1.25rem; }
    .price-current-lg { font-size: 1.6rem; }
    .product-detail-actions { flex-direction: column; }
    .catalog-results-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .catalog-hero { padding: 5rem 0 1.5rem; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .product-card-title { font-size: 0.72rem; -webkit-line-clamp: 2; }
    .price-current { font-size: 0.9rem; }
    .product-card-category { font-size: 0.62rem; }
    .cat-main-btn { padding: 0.6rem 0.65rem; font-size: 0.72rem; }
    .cat-count { display: none; }
    .cat-submenu { min-width: 180px; }
}
