/* ========================================
   BZ INGENIERÍA - TIENDA CSS
   ======================================== */

/* ========================================
   CART ICON IN HEADER
   ======================================== */
.nav__cart {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--text-light);
    border-radius: var(--radius-full);
    font-size: 20px;
    transition: all var(--transition-base);
    margin-left: 16px;
}

.nav__cart:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.cart__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: white;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    border: 2px solid white;
}

/* ========================================
   SHOP HERO
   ======================================== */
.shop-hero {
    padding: 120px 20px 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    text-align: center;
}

.shop-hero__content {
    max-width: 900px;
    margin: 0 auto;
}

.shop-hero__title {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 900;
    margin-bottom: 16px;
}

.shop-hero__subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    opacity: 0.95;
    margin-bottom: 40px;
}

.shop-hero__features {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
}

.feature-item i {
    font-size: 24px;
}

/* ========================================
   SHOP SECTION
   ======================================== */
.shop-section {
    padding: 60px 0 100px;
    background: var(--bg-gray);
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* ========================================
   SIDEBAR
   ======================================== */
.shop-sidebar {
    position: sticky;
    top: 100px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.sidebar-widget {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title i {
    color: var(--primary-color);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

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

/* Category List */
.category-list {
    list-style: none;
}

.category-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    transition: all var(--transition-base);
    cursor: pointer;
    margin-bottom: 8px;
}

.category-btn i {
    color: var(--primary-color);
    font-size: 16px;
}

.category-btn .count {
    margin-left: auto;
    background: var(--gray-200);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: white;
}

.category-btn:hover i,
.category-btn.active i {
    color: white;
}

.category-btn:hover .count,
.category-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Price Filter */
.price-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.price-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Sort Select */
.sort-select {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
}

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

/* Admin Widget */
.sidebar-widget--admin {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    border: none;
}

.sidebar-widget--admin .widget-title {
    color: white;
}

.sidebar-widget--admin .widget-title i {
    color: white;
}

/* ========================================
   SHOP MAIN
   ======================================== */
.shop-main {
    min-height: 500px;
}

/* Toolbar */
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.results-count {
    font-size: 15px;
    color: var(--text-secondary);
}

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

.toolbar-right {
    display: flex;
    gap: 8px;
}

.view-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.view-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Empty State */
.empty-state {
    padding: 80px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 80px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

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

.products-grid.list-view {
    grid-template-columns: 1fr;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--gray-100);
    overflow: hidden;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card__image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.product-badge.out-of-stock {
    background: #dc3545;
}

.product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all var(--transition-base);
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 16px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.product-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-brand {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.product-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-stock {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-stock.in-stock {
    color: #28a745;
}

.product-stock.low-stock {
    color: #ffc107;
}

.product-stock.out-of-stock {
    color: #dc3545;
}

.product-stock i {
    font-size: 10px;
}

.product-card__footer {
    padding: 0 20px 20px;
    margin-top: auto;
}

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

.price-current {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
}

.price-original {
    font-size: 16px;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.product-buttons {
    display: flex;
    gap: 10px;
}

.btn-add-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
}

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

.btn-add-cart:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

/* List View */
.products-grid.list-view .product-card {
    flex-direction: row;
}

.products-grid.list-view .product-card__image {
    width: 250px;
    aspect-ratio: auto;
}

.products-grid.list-view .product-card__body {
    padding: 30px;
}

.products-grid.list-view .product-description {
    -webkit-line-clamp: 2;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 50px;
    padding: 30px 20px;
    background: white;
    border-radius: var(--radius-md);
}

.pagination-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 6px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.page-number:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-number.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========================================
   CART SIDEBAR
   ======================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    transform: translateX(0);
}

.cart-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 16px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.cart-close:hover {
    background: var(--gray-200);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.cart-empty i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.cart-empty p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
}

.cart-item__image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
}

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

.cart-item__details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item__price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.cart-item__quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-base);
}

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

.qty-input {
    width: 50px;
    height: 28px;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.cart-item__remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.cart-item__remove:hover {
    background: #dc3545;
    color: white;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--bg-gray);
}

.cart-summary {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 15px;
    color: var(--text-secondary);
}

.summary-total {
    border-top: 2px solid var(--gray-300);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-footer .btn {
    margin-bottom: 12px;
}

.cart-footer .btn:last-child {
    margin-bottom: 0;
}

.cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.cart-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   QUICK VIEW MODAL
   ======================================== */
.quick-view-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quick-view-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: white;
    border-radius: var(--radius-lg);
    overflow-y: auto;
    z-index: 1;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 40px;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1023px) {
    .shop-layout {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }
    
    .shop-sidebar {
        top: 90px;
    }
    
    .cart-sidebar {
        width: 400px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 767px) {
    .nav__cart {
        margin-left: 8px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .shop-hero {
        padding: 100px 20px 40px;
    }
    
    .shop-hero__features {
        gap: 20px;
        font-size: 13px;
    }
    
    .feature-item i {
        font-size: 20px;
    }
    
    .shop-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .shop-sidebar {
        position: static;
        padding: 20px;
    }
    
    .sidebar-widget {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .shop-toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .toolbar-right {
        justify-content: flex-end;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .products-grid.list-view .product-card {
        flex-direction: column;
    }
    
    .products-grid.list-view .product-card__image {
        width: 100%;
        aspect-ratio: 1/1;
    }
    
    .cart-sidebar {
        width: 100%;
        max-width: 400px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pagination-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .pagination-numbers {
        width: 100%;
        justify-content: center;
    }
    
    .modal-body {
        padding: 30px 20px;
    }
}