/**
 * Taxonomy Area Page - Modern E-commerce Style
 * Same design as Product Search Page (/buscar-produtos)
 * Bootstrap 5 + Custom Styles
 */

:root {
    --brand-green: #70bb52;
    --brand-green-dark: #5da940;
    --brand-green-darker: #4a8833;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --border-light: #e0e0e0;
    --text-dark: #333333;
    --text-muted: #666666;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* Reset and Base */
.taxonomy-area-main {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
}

.navbar-main {
    margin-top: 60px;
}

.breadcrumb-custom {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.taxonomy-hero {
    background: linear-gradient(135deg, #203A24 0%, #2d5433 50%, #162614 100%);
    color: white;
    padding: 3.5rem 0 3rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.hero-description {
    font-size: 1.15rem;
    opacity: 0.95;
    max-width: 800px;
    line-height: 1.6;
}

/* ==========================================
   MAIN CONTENT LAYOUT
   ========================================== */
.content-section {
    padding: 1.5rem 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================
   SIDEBAR FILTERS
   ========================================== */
.filters-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.25rem;
    position: sticky;
    top: 80px;
}

.filters-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-label {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.form-check {
    margin-bottom: 0.625rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--brand-green);
    border-color: var(--brand-green);
}

.form-check-label {
    cursor: pointer;
    font-size: 0.9375rem;
    margin-left: 0.5rem;
}

.search-within {
    position: relative;
    display: flex;
}

.search-within .form-control {
    flex: 1;
    padding-right: 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.9375rem;
}

.search-within .form-control:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 2px rgba(112, 187, 82, 0.15);
}

.btn-search-within {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.btn-search-within:hover {
    color: var(--brand-green);
}

.btn-clear-filters {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--brand-green);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.625rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-clear-filters:hover {
    background: var(--bg-light);
    border-color: var(--brand-green);
}

/* ==========================================
   BACK BUTTON
   ========================================== */
.btn-back-to-areas {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-white);
    color: var(--brand-green);
    border: 2px solid var(--brand-green);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back-to-areas:hover {
    background: var(--brand-green);
    color: white;
    transform: translateX(-4px);
}

.btn-back-to-areas i {
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.btn-back-to-areas:hover i {
    transform: translateX(-2px);
}

/* ==========================================
   PAGINATION CONTAINER
   ========================================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1.5rem 0;
}

.pagination-wrapper {
    flex: 0 0 auto;
}

/* ==========================================
   RESULTS HEADER
   ========================================== */
.results-header {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px 8px 0 0;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
}

.results-info #resultsCount {
    font-size: 0.9375rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.results-sort label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.sort-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    background: var(--bg-white);
    transition: border-color 0.2s;
}

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

/* ==========================================
   PRODUCTS GRID (LIST VIEW)
   ========================================== */
.products-grid {
    background: transparent;
    min-height: 400px;
}

.product-list-item {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
    position: relative;
}

.product-list-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-green);
}

/* Image Section */
.product-list-image {
    flex-shrink: 0;
    width: 130px;
    position: relative;
}

.product-list-image .product-image-placeholder {
    width: 100%;
    height: 130px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border: 1px solid var(--border-light);
}

.product-list-image .product-image-placeholder i {
    font-size: 4rem;
    color: var(--text-muted);
}

.product-list-image .product-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--brand-green);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.product-list-image .product-badge.kit {
    background: #2196F3;
}

.product-list-image .product-badge.free {
    background: #FF9800;
}

/* Content Section */
.product-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.product-list-header .btn-favorite-modern {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
    background: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.product-list-header .btn-favorite-modern:hover {
    background: #fff5f5;
    transform: scale(1.1);
}

.product-list-header .btn-favorite-modern i {
    color: #dc3545;
    font-size: 1.125rem;
}

.product-list-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.product-list-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.product-list-title a:hover {
    color: var(--brand-green);
}

.product-list-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-list-rating .stars-modern {
    display: flex;
    gap: 0.125rem;
    color: #ffa500;
}

.product-list-rating .rating-count-modern {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.product-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-list-meta .meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.product-list-meta .meta-tag i {
    font-size: 0.875rem;
}

.product-list-description {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sidebar Section */
.product-list-sidebar {
    flex-shrink: 0;
    width: 245px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-light);
}

.product-list-price {
    text-align: right;
}

.product-list-price .price-current-modern {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-green);
}

.product-list-price .price-free-modern {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF9800;
}

.product-list-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-view-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #203A24;
    border: 2px solid #203A24;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-view-list:hover {
    background: var(--brand-green);
    border: 2px solid var(--brand-green);
    color: white;
}

.btn-add-cart-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: #203A24;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add-cart-list:hover {
    background: var(--brand-green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-add-cart-list:active {
    transform: translateY(0);
}

.btn-add-cart-list:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   LOADING & EMPTY STATES
   ========================================== */
#productsLoading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

#productsLoading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

#productsError {
    padding: 2rem;
    text-align: center;
}

/* ==========================================
   PAGINATION
   ========================================== */
.pagination-wrapper {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-item {
    display: block;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: var(--bg-light) !important;
    border-color: #203A24 !important;
    color: #203A24 !important;
}

.pagination .page-item.active .page-link {
    background: #203A24 !important;
    background-color: #203A24 !important;
    border-color: #203A24 !important;
    color: white !important;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 991px) {
    .content-section {
        padding: 1rem 0;
    }

    .filters-card {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        overflow-y: auto;
        border-radius: 0;
    }

    .filters-card.show {
        display: block;
    }

    .product-list-item {
        flex-direction: column;
        padding: 1rem;
    }

    .product-list-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .product-list-image .product-image-placeholder {
        height: 200px;
    }

    .product-list-sidebar {
        width: 100%;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-light);
        padding-top: 1rem;
        margin-top: 0.5rem;
    }

    .product-list-actions {
        flex-direction: row;
        gap: 0.5rem;
    }

    .btn-view-list,
    .btn-add-cart-list {
        flex: 1;
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    .product-list-title {
        font-size: 1.125rem;
    }

    .product-list-meta .meta-tag {
        font-size: 0.8125rem;
        padding: 0.25rem 0.625rem;
    }

    .product-list-description {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 767px) {
    .taxonomy-hero {
        padding: 2.5rem 0 2rem;
    }

    .hero-title {
        font-size: 1.875rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .results-sort {
        width: 100%;
        justify-content: space-between;
    }

    .pagination-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pagination-wrapper {
        width: 100%;
        overflow-x: auto;
    }

    .btn-back-to-areas {
        width: 100%;
        justify-content: center;
    }

    .navbar-main {
        margin-top: 130px;
    }
}

@media (max-width: 575px) {
    .content-section {
        padding: 0.5rem 0;
    }

    .taxonomy-hero {
        margin-bottom: 1.5rem;
        padding: 2rem 0 1.5rem;
    }

    .product-list-item {
        padding: 0.875rem;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .product-list-image {
        width: 100%;
        max-width: 150px;
    }

    .product-list-image .product-image-placeholder {
        height: 150px;
    }

    .product-list-image .product-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
    }

    .product-list-content {
        gap: 0.5rem;
    }

    .product-list-header {
        gap: 0.5rem;
    }

    .product-list-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .product-list-header .btn-favorite-modern {
        width: 32px;
        height: 32px;
    }

    .product-list-header .btn-favorite-modern i {
        font-size: 1rem;
    }

    .product-list-rating {
        font-size: 0.8125rem;
    }

    .product-list-rating .stars-modern i {
        font-size: 0.875rem;
    }

    .product-list-meta .meta-tag {
        font-size: 0.75rem;
        padding: 0.1875rem 0.5rem;
    }

    .product-list-meta .meta-tag i {
        font-size: 0.75rem;
    }

    .product-list-description {
        font-size: 0.8125rem;
        line-height: 1.5;
        -webkit-line-clamp: 2;
    }

    .product-list-sidebar {
        padding-top: 0.75rem;
        margin-top: 0.25rem;
    }

    .product-list-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-view-list,
    .btn-add-cart-list {
        width: 100%;
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }

    .btn-view-list i,
    .btn-add-cart-list i {
        font-size: 0.875rem;
    }
}

/* ==========================================
   UTILITIES
   ========================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
