/* CSS para la sección de productos (Redesign v1.0.13) */

/* Pro Top Bar & Filters Redesign */

/* Top Bar Container */
.products-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.topbar-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.topbar-left p {
    font-size: 13px;
    color: #94a3b8;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* New Search Input Style */
.top-search-group {
    position: relative;
    width: 320px;
}

.top-search-group input {
    width: 100%;
    background-color: #0f131a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 10px 16px 10px 40px;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

.top-search-group input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    outline: none;
}

.search-icon-abs {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

/* Notification Bell */
.btn-notification {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f131a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-notification:hover {
    color: white;
    border-color: #64748b;
}

/* Add Product Button */
.btn-add-product {
    background-color: #10b981;
    color: #0f131a;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add-product:hover {
    background-color: #34d399;
    transform: translateY(-2px);
}

/* Filter Bar (Card Style) */
.products-filters {
    background-color: #0f131a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Select Styling */
.filter-select {
    background-color: #1e293b;
    border: 1px solid transparent;
    border-radius: 6px;
    color: white;
    padding: 8px 12px;
    font-size: 13px;
    min-width: 140px;
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: #10b981;
}

/* Range Input Styling */
.range-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #1e293b;
    padding: 4px 8px;
    border-radius: 6px;
}

.range-input {
    background: transparent;
    border: none;
    color: white;
    width: 60px;
    font-size: 13px;
    text-align: center;
    padding: 4px;
    outline: none;
}

.range-sep {
    color: #64748b;
}

/* Apply Filters Button */
.btn-apply-filters {
    background-color: #10b981;
    color: #0f131a;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    height: 36px;
    align-self: flex-end;
    /* Align with inputs */
}

.btn-apply-filters:hover {
    background-color: #34d399;
}

/* Sort Dropdown (Right Side) */
.filter-spacer {
    flex: 1;
    /* Pushes sort to right */
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-label {
    font-size: 13px;
    color: #94a3b8;
}

/* Grid Layout */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Product Card */
.product-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-green);
}

.card-image {
    width: 100%;
    height: 200px;
    background-color: #2d3142;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.img-placeholder {
    font-size: 40px;
    color: var(--text-muted);
    font-weight: 700;
}

.card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.provider-type {
    background-color: #f39c12;
    color: white;
}

.platform-logo {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.like-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
}

.like-btn:hover {
    transform: scale(1.1);
    color: #e74c3c;
}

.card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.provider-name {
    font-size: 11px;
    color: #3498db;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    height: 40px;
    /* Limit to 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* Push to bottom */
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.price-item {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 10px;
    color: var(--text-muted);
}

.price-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.price-value.suggested {
    color: var(--accent-green);
}

.stock-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.stock-count {
    color: var(--accent-green);
    font-weight: 600;
}

.btn-send-client {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-send-client:hover {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-primary-small {
    padding: 8px 16px;
    background-color: var(--accent-green);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary-small:hover {
    background-color: var(--accent-green-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.loading-state,
.empty-state {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    color: var(--text-secondary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- PRODUCT DETAIL VIEW --- */
.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.back-nav {
    margin-bottom: 20px;
}

.btn-back {
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-back:hover {
    color: white;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
}

/* Left: Image Gallery */
.detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-image-frame {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: #0f131a;
    border-radius: 20px;
    border: 1px solid #1e293b;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-badges {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
}

.gallery-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.gallery-badge.provider {
    background: #10b981;
    color: #0f131a;
}

.gallery-badge.discount {
    background: #ef4444;
    color: white;
    position: absolute;
    right: 20px;
    top: 20px;
    left: auto;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-nav-btn.prev {
    left: 20px;
}

.gallery-nav-btn.next {
    right: 20px;
}

.thumbnails-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumb-img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    object-fit: cover;
    background: #0f131a;
}

.thumb-img.active {
    border-color: #10b981;
}

/* Right: Info */
.detail-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-header {
    border-bottom: 1px solid #1e293b;
    padding-bottom: 20px;
}

.detail-provider {
    font-size: 13px;
    color: #10b981;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.detail-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
}

.detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.final-price {
    font-size: 36px;
    font-weight: 800;
    color: white;
}

.compare-price {
    font-size: 20px;
    color: #64748b;
    text-decoration: line-through;
    font-weight: 500;
}

.detail-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #94a3b8;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item strong {
    color: #10b981;
}

/* Options (Color, etc) */
.product-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-btn {
    padding: 8px 16px;
    background: #0f131a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.color-btn:hover {
    border-color: #64748b;
}

.color-btn.selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Qty Selector */
.qty-selector {
    display: flex;
    align-items: center;
    background: #0f131a;
    border: 1px solid #334155;
    border-radius: 8px;
    width: fit-content;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.qty-val {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: white;
}

/* Actions */
.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn-send-large {
    flex: 1;
    background-color: #10b981;
    color: #0f131a;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-send-large:hover {
    background-color: #34d399;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.btn-icon-square {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #0f131a;
    border: 1px solid #334155;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-square:hover {
    border-color: #10b981;
    color: #10b981;
}

/* Guarantee Box */
.guarantee-box {
    background: #0f131a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guarantee-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.g-icon {
    width: 24px;
    color: #10b981;
    margin-top: 2px;
}

.g-text h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.g-text p {
    color: #64748b;
    font-size: 12px;
}

/* Tabs Description */
.detail-tabs {
    margin-top: 60px;
}

.tab-headers {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 24px;
}

.tab-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: white;
    border-bottom-color: #10b981;
}

.tab-content {
    background: #0f131a;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    color: #cbd5e1;
    line-height: 1.6;
}