/* Estilos específicos para la tienda */

.shop-hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.shop-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.shop-hero-description {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

.shop-section {
    padding: 4rem 0;
    min-height: 60vh;
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

/* Sidebar */
.shop-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-list a {
    display: block;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.95rem;
}

.category-list a:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.category-list a.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* Contenido principal */
.shop-main {
    flex: 1;
}

.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.results-info {
    font-weight: 600;
    color: var(--text-primary);
}

.shop-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shop-controls label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.95rem;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Grid de productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.badge-featured {
    background: var(--warning);
    color: white;
}

.badge-sale {
    background: var(--danger);
    color: white;
}

.badge-out {
    background: var(--text-tertiary);
    color: white;
}

.badge-low {
    background: var(--warning);
    color: white;
}

.product-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: min(320px, 85vw);
    overflow: hidden;
    background: var(--bg-secondary);
    padding: 0;
    margin: 0;
    border: none;
    cursor: default;
}

.product-image--add {
    cursor: pointer;
    text-align: left;
}

.product-image--add:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.product-image--add:hover img {
    transform: scale(1.03);
}

.product-image--disabled {
    cursor: not-allowed;
    opacity: 0.92;
}

.product-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: none;
}

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

.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.product-info {
    padding: 1.25rem;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.product-title a:hover {
    color: var(--primary);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-old {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-add-cart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-add-cart:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-add-cart:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Carrito en navegación */
.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.cart-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid white;
}

/* Sin productos */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.no-products svg {
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.no-products h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.no-products p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Notificación */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 600;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: var(--success);
    color: white;
}

.notification.error {
    background: var(--danger);
    color: white;
}

.notification.info {
    background: var(--primary);
    color: white;
}

/* Detalle producto (modal) */
.product-detail-trigger-wrap {
    margin: 0 0 0.75rem;
}

.btn-link-detalle {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.btn-link-detalle:hover {
    color: var(--primary-dark);
}

.shop-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.shop-modal.is-open {
    display: flex;
}

.shop-modal--video {
    z-index: 4100;
}

.shop-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.shop-modal-dialog {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow: auto;
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.shop-modal-dialog--video {
    max-width: min(960px, 96vw);
    padding: 0.75rem;
}

.shop-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 2rem 1rem 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.shop-modal-body {
    margin-bottom: 1rem;
}

.detail-modal-desc {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.shop-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-modal-datasheet,
.detail-modal-video-actions {
    margin: 0;
}

.btn-detail-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.btn-detail-download:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-detail-video {
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-detail-video:hover {
    background: var(--primary-dark);
}

.btn-detail-video--external {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.shop-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.shop-modal-close:hover {
    background: var(--danger);
    color: white;
}

.shop-modal-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #0f172a;
}

.shop-modal-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    
    .shop-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .sidebar-widget {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .shop-hero {
        padding: 120px 0 60px;
    }
    
    .shop-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .shop-controls {
        justify-content: space-between;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .shop-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .shop-section {
        padding: 2rem 0;
    }
}

/* ——— Tienda principal: trust bar, chips, paginación ——— */
.trust-bar {
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.75rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #1e293b;
}
.trust-bar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    justify-content: center;
}
.shop-hero--main {
    padding: 120px 0 48px;
}
.shop-hero-eyebrow {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}
.shop-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}
.shop-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
}
.shop-breadcrumb {
    padding: 1rem 0 0;
    font-size: 0.9rem;
}
.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--text-secondary);
}
.breadcrumb-list li + li::before {
    content: '›';
    margin-right: 0.35rem;
    opacity: 0.5;
}
.breadcrumb-list a {
    color: var(--primary);
    text-decoration: none;
}
.shop-cat-chips {
    padding: 1rem 0 0;
}
.cat-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cat-chip {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}
.cat-chip:hover,
.cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.shop-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.page-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    background: var(--bg-secondary);
}
.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.page-num {
    min-width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid transparent;
    font-weight: 500;
}
.page-num:hover {
    border-color: var(--border);
    background: var(--bg-secondary);
}
.page-num.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.page-ellipsis {
    padding: 0 0.25rem;
    color: var(--text-secondary);
}
.shop-cat-seo-text {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    line-height: 1.7;
}
.shop-services-block {
    border-top: 1px solid var(--border);
}
.shop-services-cta {
    text-align: center;
    margin-top: 2rem;
}
.product-image--link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}
.product-title a {
    color: inherit;
    text-decoration: none;
}
.product-title a:hover {
    color: var(--primary);
}
.producto-detail-section {
    padding: 100px 0 4rem;
}
.producto-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.producto-main-img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}
.producto-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.producto-sku {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.price-current--lg {
    font-size: 2rem;
    font-weight: 800;
}
.btn-add-cart--lg {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    margin-top: 1rem;
}
.btn-wa-producto {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #25d366;
    color: #075e54;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
}
.producto-trust-list {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.producto-trust-list li {
    padding: 0.35rem 0;
}
.producto-stock--low { color: #d97706; font-weight: 600; }
.producto-stock--out { color: var(--danger); font-weight: 600; }
.producto-stock--ok { color: #16a34a; font-weight: 600; }
.producto-long-desc {
    margin-top: 2.5rem;
    max-width: 800px;
}
.producto-relacionados {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.products-grid--related {
    margin-top: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* Tarjetas compactas (productos relacionados) */
.product-card--compact .product-title {
    font-size: 0.95rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card--compact .product-info {
    padding: 0.875rem 1rem 1rem;
}

.product-card--compact .product-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.product-card--compact .product-price {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.product-card--compact .price-current {
    font-size: 1.1rem;
}

.product-card--compact .btn-add-cart {
    width: 100%;
    justify-content: center;
    padding: 0.625rem 0.75rem;
}

@media (max-width: 768px) {
    .producto-detail-grid {
        grid-template-columns: 1fr;
    }
    .trust-bar-inner span {
        font-size: 0.78rem;
    }
}
