/**
 * Catalog Page Styles
 *
 * Filter drawer, product grid, filter form, pagination.
 * Editorial luxury aesthetic — deep redesign.
 */

/* ========================================
   Catalog Layout
   ======================================== */

.catalog-page {
    padding-top: var(--spacing-2xl);
    padding-bottom: var(--spacing-3xl);
}

.catalog-header {
    margin-bottom: var(--spacing-2xl);
}

.catalog-title {
    font-family: var(--font-display);
    font-size: var(--font-size-3xl);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-lg);
}

.catalog-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.catalog-filter-toggle {
    gap: var(--spacing-xs);
}

.catalog-sort-select {
    background-color: transparent;
    border: 1px solid var(--color-border);
    padding: 10px var(--spacing-md);
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    letter-spacing: 0.05em;
    cursor: pointer;
    outline: none;
    transition: border-color 0.4s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23a39e97' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.catalog-sort-select:focus {
    border-color: var(--color-accent);
}

.catalog-sort-select option {
    background-color: var(--color-bg-card);
    color: var(--color-text);
}

.catalog-results-count {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-left: auto;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.catalog-content {
    position: relative;
}

/* ========================================
   Product Grid — Breathing Room
   ======================================== */

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    row-gap: 3rem;
    transition: opacity 0.3s ease;
}

.catalog-grid.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

@media (max-width: 992px) {
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        row-gap: 2.5rem;
    }
}

@media (max-width: 576px) {
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        row-gap: 2rem;
    }
}

.catalog-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-3xl) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
    font-family: var(--font-display);
    font-weight: 400;
}

/* ========================================
   Product Card — Editorial
   ======================================== */

.product-card {
    background-color: transparent;
    overflow: hidden;
    transition: all 0.4s ease;
    animation: fadeInUp 0.6s ease both;
}

.product-card:nth-child(1) { animation-delay: 0s; }
.product-card:nth-child(2) { animation-delay: 0.05s; }
.product-card:nth-child(3) { animation-delay: 0.1s; }
.product-card:nth-child(4) { animation-delay: 0.15s; }
.product-card:nth-child(5) { animation-delay: 0.2s; }
.product-card:nth-child(6) { animation-delay: 0.25s; }
.product-card:nth-child(7) { animation-delay: 0.3s; }
.product-card:nth-child(8) { animation-delay: 0.35s; }
.product-card:nth-child(9) { animation-delay: 0.4s; }

.product-card:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-image {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background-color: var(--color-bg-elevated);
}

.product-card-img,
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.product-card:hover .product-card-img,
.product-card:hover .product-card-image img {
    transform: scale(1.06);
}

.product-card-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-elevated);
}

/* Sold badge — elegant diagonal ribbon */
.product-card-sold-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    z-index: 2;
}

.product-card-sold-badge::before {
    content: 'VENDIDO';
    position: absolute;
    top: 24px;
    right: -32px;
    width: 150px;
    text-align: center;
    transform: rotate(45deg);
    background-color: var(--color-sold);
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    padding: 6px 0;
}

/* Hover overlay with condition badge */
.product-card-hover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.product-card:hover .product-card-hover-overlay {
    opacity: 1;
    transform: translateY(0);
}

.product-card-hover-overlay .condition-badge {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    letter-spacing: 0.1em;
}

.product-card-info {
    padding: 1rem 0 0.5rem;
}

.product-card-brand {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.625rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    margin-bottom: 4px;
}

.product-card-title {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-meta {
    margin-bottom: 0;
}

.product-card-price {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
}

.product-card-price .woocommerce-Price-currencySymbol {
    font-size: 0.7em;
    vertical-align: super;
}

.product-card-price del {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.product-card-price ins {
    text-decoration: none;
    color: var(--color-sold);
}

/* ========================================
   Filter Drawer
   ======================================== */

.filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 100%;
    z-index: 10000;
    background-color: var(--color-bg);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 0.4s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-drawer.filter-drawer--open {
    transform: translateX(0);
}

/* Backdrop overlay */
.filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.filter-drawer-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 576px) {
    .filter-drawer {
        width: 100%;
    }
}

.filter-drawer-inner {
    padding: var(--spacing-xl);
}

.filter-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.filter-drawer-title {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: 400;
    margin-bottom: 0;
}

.filter-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    transition: color 0.4s ease;
}

.filter-drawer-close:hover {
    color: var(--color-text);
}

/* ========================================
   Filter Form
   ======================================== */

.filter-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.filter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-checkbox-list--scrollable {
    max-height: 200px;
    overflow-y: auto;
    padding-right: var(--spacing-xs);
}

.filter-checkbox-list--scrollable::-webkit-scrollbar {
    width: 3px;
}

.filter-checkbox-list--scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.filter-checkbox-list--scrollable::-webkit-scrollbar-thumb {
    background-color: var(--color-border);
    border-radius: 2px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 5px 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: color 0.4s ease;
}

.filter-checkbox:hover {
    color: var(--color-accent);
}

.filter-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--color-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.filter-checkbox-label {
    flex: 1;
}

.filter-checkbox-count {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

.filter-condition-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Price range */

.filter-price-inputs {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.filter-price-input {
    flex: 1;
    background-color: transparent;
    border: 1px solid var(--color-border);
    padding: 8px var(--spacing-sm);
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    outline: none;
    width: 80px;
    transition: border-color 0.4s ease;
}

.filter-price-input:focus {
    border-color: var(--color-accent);
}

.filter-price-input::placeholder {
    color: var(--color-text-muted);
}

.filter-price-separator {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

.filter-price-currency {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* Filter actions */

.filter-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-md);
}

.filter-apply {
    flex: 1;
}

.filter-reset {
    flex-shrink: 0;
}

/* ========================================
   Catalog Pagination
   ======================================== */

.catalog-pagination {
    margin-top: var(--spacing-2xl);
}

.catalog-pagination .woocommerce-pagination {
    text-align: center;
}
