/* ================================================================
   TRADEPRINT THEME — PAGES/PRODUCT.CSS
   Product Category Listing · Product Detail / Configurator
   ================================================================ */

/* ----------------------------------------------------------------
   CATEGORY PAGE — LAYOUT
   ---------------------------------------------------------------- */
.category-page {
    background: var(--tp-bg);
    min-height: 60vh;
}

.category-page__layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

/* ----------------------------------------------------------------
   FILTER SIDEBAR
   ---------------------------------------------------------------- */
.filter-sidebar {
    background: var(--tp-white);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: 136px;
}

.filter-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--tp-border);
}

.filter-sidebar__title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--tp-text);
}

.filter-clear-btn {
    font-size: var(--font-size-xs);
    color: var(--tp-green);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    transition: color .15s;
}

.filter-clear-btn:hover { color: var(--tp-green-dark); }

.filter-group {
    border-bottom: 1px solid var(--tp-border);
}

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

.filter-group__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: none;
    border: none;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--tp-text);
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}

.filter-group__toggle:hover { background: var(--tp-bg); }

.filter-group__toggle i {
    font-size: 10px;
    color: var(--tp-text-muted);
    transition: transform .2s;
}

.filter-group__toggle.open i { transform: rotate(180deg); }

.filter-group__body {
    padding: 0 18px 14px;
    display: none;
}

.filter-group__body.open { display: block; }

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    transition: color .15s;
}

.filter-option:hover { color: var(--tp-green); }

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

.filter-option span {
    font-size: var(--font-size-sm);
    color: var(--tp-text);
    flex: 1;
}

.filter-option .count {
    font-size: 11px;
    color: var(--tp-text-light);
    background: var(--tp-bg);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
}

/* Price range */
.price-range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.price-range-inputs input {
    padding: 7px 10px;
    border: 1.5px solid var(--tp-border-dark);
    border-radius: var(--radius);
    font-size: var(--font-size-xs);
    color: var(--tp-text);
    outline: none;
    transition: border-color .2s;
}

.price-range-inputs input:focus { border-color: var(--tp-green); }

/* ----------------------------------------------------------------
   PRODUCT LISTING TOOLBAR
   ---------------------------------------------------------------- */
.listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--tp-white);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.listing-count {
    font-size: var(--font-size-sm);
    color: var(--tp-text-muted);
}

.listing-count strong {
    color: var(--tp-text);
    font-weight: 700;
}

.listing-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.listing-sort label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--tp-text);
    white-space: nowrap;
}

.listing-sort select {
    padding: 7px 32px 7px 10px;
    border: 1.5px solid var(--tp-border-dark);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    color: var(--tp-text);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%236b7280' d='M0 0l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    transition: border-color .2s;
}

.listing-sort select:focus { border-color: var(--tp-green); }

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 34px;
    height: 34px;
    border: 1.5px solid var(--tp-border-dark);
    border-radius: var(--radius);
    background: var(--tp-white);
    font-size: 13px;
    color: var(--tp-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.view-btn.active,
.view-btn:hover {
    border-color: var(--tp-green);
    color: var(--tp-green);
    background: var(--tp-green-pale);
}

/* Active filters chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tp-green-pale);
    border: 1px solid var(--tp-green-light);
    color: var(--tp-green-dark);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
}

.filter-chip button {
    background: none;
    border: none;
    color: var(--tp-green);
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color .15s;
}

.filter-chip button:hover { color: var(--tp-red); }

/* Product grid (listing) */
.product-grid { }

/* ----------------------------------------------------------------
   PRODUCT DETAIL PAGE
   ---------------------------------------------------------------- */
.product-detail {
    background: var(--tp-white);
}

.product-detail__layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 40px;
    align-items: start;
}

/* Gallery */
.product-gallery { position: sticky; top: 136px; }

.gallery-main {
    background: var(--tp-bg);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-lg);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}

.gallery-main__placeholder {
    font-size: 5rem;
    color: var(--tp-text-light);
    opacity: .35;
}

.gallery-zoom {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,.9);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--tp-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.gallery-zoom:hover { background: var(--tp-white); color: var(--tp-green); }

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border: 2px solid var(--tp-border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tp-bg);
    font-size: 1.5rem;
    color: var(--tp-text-light);
}

.gallery-thumb.active,
.gallery-thumb:hover { border-color: var(--tp-green); }

/* Product Info Panel */
.product-info__heading {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--tp-text);
    letter-spacing: -.4px;
    margin-bottom: 8px;
}

.product-info__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.product-info__rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-info__rating .stars { color: #00b67a; font-size: 13px; }
.product-info__rating .count { font-size: var(--font-size-xs); color: var(--tp-text-muted); }

.product-info__sku {
    font-size: var(--font-size-xs);
    color: var(--tp-text-muted);
    background: var(--tp-bg);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
}

.product-info__short-desc {
    font-size: var(--font-size-sm);
    color: var(--tp-text-muted);
    line-height: 1.75;
    margin-bottom: 20px;
}

/* Configurator */
.configurator {
    background: var(--tp-bg);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.config-section { margin-bottom: 20px; }
.config-section:last-child { margin-bottom: 0; }

.config-label {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--tp-text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-label .config-selected {
    font-weight: 400;
    color: var(--tp-text-muted);
    margin-left: auto;
    font-size: var(--font-size-xs);
}

.config-label .config-hint {
    width: 16px;
    height: 16px;
    background: var(--tp-text-light);
    color: var(--tp-white);
    border-radius: 50%;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

/* Option buttons */
.config-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.config-opt {
    padding: 7px 14px;
    border: 1.5px solid var(--tp-border-dark);
    border-radius: var(--radius);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--tp-text);
    background: var(--tp-white);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.config-opt:hover { border-color: var(--tp-green); color: var(--tp-green); }

.config-opt.selected {
    border-color: var(--tp-green);
    background: var(--tp-green-pale);
    color: var(--tp-green-dark);
}

.config-opt.disabled {
    opacity: .4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Quantity selector */
.qty-selector {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--tp-border-dark);
    border-radius: var(--radius);
    overflow: hidden;
    width: fit-content;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background: var(--tp-bg);
    border: none;
    font-size: 18px;
    color: var(--tp-text-muted);
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: var(--tp-border); color: var(--tp-text); }

.qty-input {
    width: 70px;
    height: 40px;
    border: none;
    border-left: 1.5px solid var(--tp-border);
    border-right: 1.5px solid var(--tp-border);
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--tp-text);
    outline: none;
}

/* Price summary */
.price-summary {
    background: var(--tp-white);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: 16px;
}

.price-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: var(--font-size-sm);
    color: var(--tp-text-muted);
    border-bottom: 1px solid var(--tp-border);
}

.price-summary__row:last-child { border-bottom: none; }

.price-summary__row strong {
    color: var(--tp-text);
    font-weight: 700;
}

.price-summary__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 0 0;
    margin-top: 4px;
}

.price-summary__total .label {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--tp-text);
}

.price-summary__total .amount {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--tp-green);
    letter-spacing: -.5px;
}

.price-summary__vat {
    font-size: var(--font-size-xs);
    color: var(--tp-text-muted);
    text-align: right;
}

/* Add to cart */
.add-to-cart-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.add-to-cart-btn {
    width: 100%;
    padding: 14px;
    background: var(--tp-green);
    color: var(--tp-white);
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-md);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

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

/* Product tabs (description / spec / reviews) */
.detail-tabs {
    border-bottom: 2px solid var(--tp-border);
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar { display: none; }

.detail-tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--tp-text-muted);
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -2px;
    transition: var(--transition-fast);
}

.detail-tab-btn:hover { color: var(--tp-text); }
.detail-tab-btn.active { color: var(--tp-green); border-bottom-color: var(--tp-green); }

.detail-tab-pane { display: none; }
.detail-tab-pane.active { display: block; animation: fadeIn .25s ease-out; }

/* Specs table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr { border-bottom: 1px solid var(--tp-border); }
.specs-table tr:last-child { border-bottom: none; }

.specs-table td {
    padding: 12px 0;
    font-size: var(--font-size-sm);
    vertical-align: top;
}

.specs-table td:first-child {
    width: 40%;
    font-weight: 700;
    color: var(--tp-text);
    padding-right: 20px;
}

.specs-table td:last-child {
    color: var(--tp-text-muted);
}

/* ----------------------------------------------------------------
   RESPONSIVE — PRODUCT PAGES
   ---------------------------------------------------------------- */
@media (max-width: 1199px) {
    .category-page__layout { grid-template-columns: 220px 1fr; }
    .product-detail__layout { grid-template-columns: 1fr 360px; }
}

@media (max-width: 991px) {
    .category-page__layout { grid-template-columns: 1fr; }
    .filter-sidebar { position: static; display: none; }
    .filter-sidebar.mobile-open { display: block; }
    .product-detail__layout { grid-template-columns: 1fr; }
    .product-gallery { position: static; }
    .configurator { padding: 18px; }
}

@media (max-width: 575px) {
    .listing-toolbar { flex-direction: column; align-items: flex-start; }
    .product-detail__layout { gap: 24px; }
    .price-summary__total .amount { font-size: 1.6rem; }
}
