/* Catálogo Oficial - Página de Categoria - CSS */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-bg: #ecf0f1;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --success-color: #27ae60;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation Bar */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-header {
    padding: 15px 20px;
    border-bottom: 2px solid var(--light-bg);
}

.navbar-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-title i {
    color: var(--secondary-color);
}

.navbar-link-back {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 5px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar-link-back:hover {
    background-color: var(--light-bg);
    color: var(--secondary-color);
}

.navbar-categories {
    padding: 15px 20px;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar-cat-link {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
    cursor: pointer;
}

.navbar-cat-link:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background-color: #f0f7ff;
}

.navbar-cat-link.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
    border-color: var(--secondary-color);
}

/* Subcategorias Container */
.subcategorias-container {
    background: white;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.subcategorias-wrapper {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.subcategoria-btn {
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: capitalize;
}

.subcategoria-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background-color: #f0f7ff;
}

.subcategoria-btn.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
    border-color: var(--secondary-color);
}

/* Subcategoria Group Divider */
.subcategoria-group {
    margin-bottom: 40px;
}

.subcategoria-divider {
    margin-bottom: 25px;
    padding-bottom: 15px;
}

.subcategoria-title {
    font-size: 1rem;
    font-weight: 600;
    color: #555555;
    margin-bottom: 12px;
    text-transform: capitalize;
}

.divider-line {
    height: 2px;
    background-color: #999999;
    width: 100%;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 10px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header-content {
    flex: 1;
    min-width: 300px;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 700;
    text-transform: capitalize;
}

.page-header p {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 300;
}

.page-header-info {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
}

.page-header-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Products Grid */
.products-section {
    margin-bottom: 50px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--secondary-color);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--light-bg);
}

.product-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-info {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-info strong {
    color: var(--text-dark);
    display: block;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success-color);
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--light-bg);
}

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    gap: 5px;
    list-style: none;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: block;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.pagination span.current {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
    border-color: var(--secondary-color);
}

.pagination span.disabled {
    color: var(--text-light);
    cursor: not-allowed;
    background-color: var(--light-bg);
}

.page-info {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

.page-info strong {
    color: var(--text-dark);
}

/* PDF Section */
.pdf-section {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.btn-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-download-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-download-pdf i {
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    border: 2px dashed var(--border-color);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px 15px;
        margin-bottom: 20px;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
    }
    
    .page-header h1 {
        font-size: 1.6rem;
        margin-bottom: 3px;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    .page-header-info {
        flex-direction: column;
        gap: 8px;
        font-size: 0.85rem;
    }
    
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        margin-bottom: 20px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-content {
        padding: 8px 10px;
    }
    
    .product-name {
        font-size: 0.8rem;
        font-weight: 500;
        margin-bottom: 3px;
        height: auto;
        line-height: 1.2;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-info {
        font-size: 0.75rem;
        margin-bottom: 3px;
        line-height: 1.2;
    }
    
    .product-info strong {
        display: inline;
        font-size: 0.75rem;
        margin-right: 4px;
    }
    
    .product-price {
        font-size: 1rem;
        padding-top: 2px;
        margin-top: auto;
        border-top: none;
    }
    
    .navbar {
        border-radius: 0;
        margin-bottom: 0;
    }
    
    .navbar-categories {
        padding: 10px;
        gap: 8px;
    }
    
    .navbar-cat-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .subcategorias-container {
        border-radius: 0;
        margin-bottom: 0;
    }
    
    .subcategorias-wrapper {
        padding: 10px 15px;
        gap: 8px;
    }
    
    .subcategoria-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        border-width: 1px;
    }
    
    .subcategoria-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .divider-line {
        height: 1px;
    }
    
    .subcategoria-group {
        margin-bottom: 25px;
    }
}

/* 小屏幕 (< 480px) - 单列水平布局 */
@media (max-width: 479px) {
    .container {
        padding: 0;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .page-header {
        padding: 20px 12px;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .page-header-info {
        font-size: 0.8rem;
    }
    
    /* 单列布局 */
    .products-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 15px;
    }
    
    /* 卡片水平排列 */
    .product-card {
        display: flex;
        flex-direction: row;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-bottom: 1px solid #e0e0e0;
        overflow: visible;
        transition: none;
        height: auto;
        min-height: 100px;
    }
    
    .product-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* 图片左侧正方形 */
    .product-image-wrapper {
        width: 100px;
        min-width: 100px;
        height: 100px;
        /*padding-bottom: 0 !important;*/
        /*注意上面这个属性如果开启会影响图片显示，开启后在catalogo产品图片会显示矩形（必须处于注释状态）示为警告 */
        overflow: hidden;
        background: var(--light-bg);
        position: relative;
        flex-shrink: 0;
    }
    
    .product-image-wrapper img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* 内容右侧充满 */
    .product-content {
        padding: 8px 12px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .product-name {
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.3;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 4px;
        height: auto;
    }
    
    .product-info {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 4px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .product-info strong {
        display: inline;
        color: var(--text-dark);
        font-weight: 600;
    }
    
    .product-price {
        font-size: 1.1rem;
        font-weight: 700;
        margin-top: 4px;
        padding-top: 0;
        border-top: none;
    }
    
    .navbar {
        border-radius: 0;
        margin-bottom: 0;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }
    
    .navbar-header {
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .navbar-title {
        font-size: 1.1rem;
        gap: 8px;
    }
    
    .navbar-link-back {
        font-size: 0.85rem;
        padding: 4px 10px;
    }
    
    .back-text-full {
        display: none;
    }
    
    .back-text-short {
        display: inline;
    }
    
    .navbar-categories {
        padding: 8px 12px;
        gap: 5px;
        overflow-x: auto;
    }
    
    .navbar-cat-link {
        padding: 5px 10px;
        font-size: 0.8rem;
        border-width: 1px;
        border-radius: 4px;
    }
    
    .subcategorias-container {
        border-radius: 0;
        margin-bottom: 0;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }
    
    .subcategorias-wrapper {
        padding: 8px 12px;
        gap: 5px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .subcategoria-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        border-width: 1px;
        border-radius: 4px;
        white-space: nowrap;
    }
    
    .subcategoria-title {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .divider-line {
        height: 1px;
    }
    
    .subcategoria-group {
        margin-bottom: 15px;
    }
    
    .btn-download-pdf {
        padding: 10px 18px;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
}

/* 中等屏幕 (480px - 767px) - 平板优化 */
@media (min-width: 480px) and (max-width: 767px) {
    .products-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .product-image {
        height: 100px;
    }
    
    .product-content {
        padding: 6px 8px;
    }
    
    .product-name {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 2px;
    }
    
    .product-info {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .product-info strong {
        display: inline;
        margin-right: 3px;
    }
    
    .product-price {
        font-size: 0.95rem;
    }
}
