/* Product detail and catalogue page styling.
   Loaded only on product routes; color accents inherit the active site theme. */
.product-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    align-items: start;
    gap: clamp(28px, 5vw, 68px);
    margin: 4px auto 30px;
}

.product-detail-gallery {
    min-width: 0;
    position: sticky;
    top: 92px;
}

.product-main-image {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: clamp(300px, 37vw, 470px);
    overflow: hidden;
    border: 1px solid var(--border-color, #eadfca);
    border-radius: var(--card-radius, 12px);
    background: linear-gradient(145deg, #fffdf8, #f7f1e6);
    padding: clamp(22px, 4vw, 48px);
}

.product-main-image > img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-main-image .product-image-placeholder.xl {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 220px;
    border-radius: 8px;
    color: var(--primary, #c47c16);
    background: #f3ead7;
    font-size: clamp(3rem, 8vw, 5.5rem);
}

.product-image-badges,
.product-badges-top {
    position: absolute;
    z-index: 1;
    inset: 14px 14px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    pointer-events: none;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--sale-badge-text, #fff);
    background: var(--sale-badge-bg, #a94d19);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(42, 29, 11, .12);
}

.product-badge.badge-coupon {
    color: #5e3b08;
    background: #f6d98d;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding: 2px 1px 6px;
}

.product-thumb {
    display: grid;
    place-items: center;
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    overflow: hidden;
    border: 1px solid var(--border-color, #eadfca);
    border-radius: 8px;
    background: var(--card-bg, #fffdf8);
    padding: 7px;
    transition: border-color .18s ease, transform .18s ease;
}

.product-thumb:hover,
.product-thumb.active {
    border-color: var(--primary, #bd7818);
}

.product-thumb:hover { transform: translateY(-2px); }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; }

.product-detail-info {
    min-width: 0;
    padding: 3px 0 0;
}

.product-detail-meta-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 13px;
}

.product-brand-label {
    color: var(--primary, #a8630e);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.product-detail-category {
    color: var(--text-light, #776d5e);
    font-size: 13px;
}

.product-detail-info h1 {
    max-width: 760px;
    margin: 0 0 12px;
    color: var(--heading-color, #2c2418);
    font-size: clamp(1.8rem, 3.1vw, 2.7rem);
    letter-spacing: -.035em;
    line-height: 1.13;
    overflow-wrap: anywhere;
}

.product-from {
    margin: 0 0 12px;
    color: var(--text-light, #776d5e);
    font-size: 14px;
}

.product-from i { margin-right: 5px; color: var(--primary, #bd7818); }
.product-from a { color: var(--link-color, #9b5d0c); font-weight: 700; }
.product-from a:hover { color: var(--link-hover, #754408); text-decoration: underline; }

.product-rating-detail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 18px;
}

.star-rating-lg { display: inline-flex; gap: 2px; color: #d69216; font-size: 15px; }
.rating-value-lg { color: var(--heading-color, #2c2418); font-weight: 750; }
.review-count-detail { color: var(--text-light, #776d5e); font-size: 13px; }

.product-pricing-detail {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid var(--border-color, #eadfca);
    border-radius: 10px;
    background: var(--bg-light, #f7f1e6);
}

.product-detail-price {
    color: var(--heading-color, #2c2418);
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.1;
}

.product-detail-price.sale { color: var(--primary, #a8610d); }
.product-detail-price.original {
    color: var(--text-light, #776d5e);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: line-through;
}

.product-save-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #57400e;
    background: #f3d994;
    font-size: 12px;
    font-weight: 750;
}

.product-deal-highlights {
    display: grid;
    gap: 8px;
    margin: 0 0 17px;
}

.deal-highlight {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #ead9ae;
    border-radius: 9px;
    padding: 11px 13px;
    color: #6d4a11;
    background: #fff9e9;
}

.deal-highlight > i { width: 18px; flex: 0 0 18px; color: var(--primary, #b77312); text-align: center; }
.deal-highlight div { display: grid; gap: 2px; min-width: 0; }
.deal-highlight strong { color: #463318; font-size: 13px; }
.deal-highlight span { color: #796b52; font-size: 12px; line-height: 1.4; }
.deal-highlight-coupon { border-color: #e8d0a2; background: #fff5df; }

.product-description {
    margin: 0 0 20px;
    color: var(--text-color, #51483a);
    font-size: 14px;
    line-height: 1.75;
    white-space: normal;
}

.product-actions { margin: 0 0 15px; }
.product-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    max-width: 100%;
    text-align: center;
    white-space: normal;
}

.product-identifiers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 18px;
    margin: 0 0 19px;
    color: var(--text-light, #776d5e);
    font-size: 12px;
}

.product-identifiers strong { color: var(--heading-color, #3c3020); }

.product-specs {
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid var(--border-color, #eadfca);
    border-radius: 10px;
    background: var(--card-bg, #fffdf8);
}

.product-specs h3 {
    margin: 0;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color, #eadfca);
    color: var(--heading-color, #352918);
    background: var(--bg-light, #f7f1e6);
    font-size: 15px;
}

.product-specs h3 i { margin-right: 7px; color: var(--primary, #a8630e); }
.specs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs-table tr + tr { border-top: 1px solid var(--border-color, #eee5d5); }
.specs-table th,
.specs-table td { padding: 10px 16px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.specs-table th { width: 36%; color: var(--text-light, #776d5e); font-weight: 600; }
.specs-table td { color: var(--text-color, #51483a); }

.related-section { margin-top: clamp(42px, 7vw, 76px); }
.related-section > h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 20px;
    color: var(--heading-color, #2c2418);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}
.related-section > h2 i { color: var(--primary, #a8630e); font-size: .85em; }

/* Catalogue page selectors used by products.php */
.uh-page-body { padding: clamp(25px, 4vw, 44px) 0 64px; }
.uh-product-filter-bar {
    margin: 0 0 24px;
    border: 1px solid var(--border-color, #eadfca);
    border-radius: 12px;
    padding: 14px;
    background: var(--card-bg, #fffdf8);
    box-shadow: 0 4px 16px rgba(53, 39, 16, .045);
}

.uh-pf-form {
    display: grid;
    grid-template-columns: minmax(200px, 1.5fr) repeat(3, minmax(130px, .8fr)) auto;
    align-items: center;
    gap: 10px;
}

.uh-pf-search {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 42px;
    gap: 9px;
    border: 1px solid var(--input-border, #dfd4c1);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-light, #776d5e);
    background: var(--input-bg, #fff);
}
.uh-pf-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text-color, #51483a); background: transparent; font-size: 14px; }
.uh-pf-search:focus-within { border-color: var(--input-focus, #bd7818); box-shadow: 0 0 0 3px var(--primary-alpha-10, rgba(189,120,24,.1)); }
.uh-pf-select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid var(--input-border, #dfd4c1);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text-color, #51483a);
    background: var(--input-bg, #fff);
    font-size: 13px;
}
.uh-pf-select:focus { outline: 2px solid var(--primary-alpha-20, rgba(189,120,24,.2)); border-color: var(--input-focus, #bd7818); }
.uh-pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    border-radius: var(--btn-radius, 8px);
    padding: 0 15px;
    color: var(--btn-primary-text, #fff);
    background: var(--btn-primary-bg, var(--primary, #bd7818));
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .18s ease, transform .18s ease;
}
.uh-pf-btn:hover { background: var(--btn-primary-hover, #945b12); transform: translateY(-1px); }

.uh-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}

.uh-product-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--card-border, #e9dfcd);
    border-radius: var(--card-radius, 12px);
    background: var(--card-bg, #fffdf8);
    box-shadow: 0 3px 13px rgba(50, 37, 16, .045);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.uh-product-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-alpha-40, #d8af70);
    box-shadow: 0 10px 26px rgba(50, 37, 16, .11);
}

.uh-pc-image {
    position: relative;
    display: grid;
    place-items: center;
    height: 204px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color, #eee5d5);
    background: linear-gradient(145deg, #fffdf8, #f7f1e6);
    padding: 19px;
}
.uh-pc-image > img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.uh-product-card:hover .uh-pc-image > img { transform: scale(1.035); }
.uh-pc-placeholder { display: flex; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 8px; }
.uh-pc-ph-initial { font-size: 42px; font-weight: 800; line-height: 1; }
.uh-pc-ph-brand { max-width: 90%; overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.uh-pc-badges { position: absolute; inset: 10px 10px auto; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.uh-pc-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 5px 8px; color: #fff; background: var(--sale-badge-bg, #a94d19); font-size: 11px; font-weight: 750; line-height: 1.2; }
.uh-pc-badge-coupon { color: #553a0b; background: #f6d98d; }

.uh-pc-body { display: flex; flex: 1; flex-direction: column; gap: 9px; padding: 14px 15px 10px; }
.uh-pc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; min-height: 17px; color: var(--text-light, #776d5e); font-size: 11px; }
.uh-pc-cat { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.uh-pc-brand { color: var(--primary, #a8630e); font-weight: 750; }
.uh-pc-title { margin: 0; color: var(--heading-color, #2c2418); font-size: 15px; line-height: 1.38; }
.uh-pc-title a { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.uh-pc-title a:hover { color: var(--link-hover, #8b530d); }
.uh-pc-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12px; }
.uh-pc-stars { color: #d69216; white-space: nowrap; }
.uh-pc-rating-val { color: var(--heading-color, #3c3020); font-weight: 700; }
.uh-pc-reviews { color: var(--text-light, #776d5e); }
.uh-pc-pricing { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 2px; }
.uh-pc-price-sale { color: var(--primary, #a8610d); font-size: 19px; font-weight: 800; letter-spacing: -.025em; }
.uh-pc-price-orig { color: var(--text-light, #776d5e); font-size: 12px; text-decoration: line-through; }
.uh-pc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    margin: 0 14px 14px;
    border: 1px solid var(--primary, #bd7818);
    border-radius: 8px;
    color: var(--primary, #9b5d0c);
    font-size: 13px;
    font-weight: 700;
    transition: color .18s ease, background .18s ease;
}
.uh-pc-btn:hover { color: var(--btn-primary-text, #fff); background: var(--btn-primary-bg, var(--primary, #bd7818)); }

.uh-page-hero .uh-page-hero-sub { max-width: 680px; }

@media (max-width: 1050px) {
    .uh-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .uh-pf-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .uh-pf-search { grid-column: span 2; }
}

@media (max-width: 760px) {
    .product-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 25px; }
    .product-detail-gallery { position: static; }
    .product-main-image { height: min(82vw, 390px); min-height: 260px; }
    .product-main-image > img { padding: 4px; }
    .product-detail-info h1 { font-size: clamp(1.65rem, 7vw, 2.25rem); }
    .product-pricing-detail { padding: 13px 14px; }
    .uh-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
    .uh-pc-image { height: clamp(145px, 43vw, 205px); padding: 14px; }
    .uh-pc-body { padding: 12px 12px 9px; gap: 7px; }
    .uh-pc-title { font-size: 14px; }
    .uh-pc-btn { margin: 0 11px 11px; }
}

@media (max-width: 520px) {
    .uh-pf-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
    .uh-pf-search { grid-column: 1 / -1; }
    .uh-pf-btn { grid-column: 1 / -1; }
    .uh-product-grid { gap: 10px; }
    .uh-pc-image { height: 155px; padding: 12px; }
    .uh-pc-meta { font-size: 10px; }
    .uh-pc-title { font-size: 13px; }
    .uh-pc-price-sale { font-size: 17px; }
    .uh-pc-btn { min-height: 38px; padding: 0 7px; font-size: 12px; }
    .specs-table th, .specs-table td { padding: 9px 11px; }
    .product-buy-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .product-thumb,
    .uh-product-card,
    .uh-pc-image > img,
    .uh-pf-btn,
    .uh-pc-btn { transition: none; }
}
