/* ============================================
   CouponHunterHub — Product Detail Page
   Sales Conversion + SEO + Ads Optimized
   Font: Inter
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --red:         #e63946;
    --red-dark:    #b71c2a;
    --red-light:   #fff0f1;
    --orange:      #f4812a;
    --orange-dark: #c45e0d;
    --orange-light:#fff6ee;
    --green:       #1a7a4a;
    --green-light: #e8f8ee;
    --blue:        #1a56db;
    --blue-light:  #eff5ff;
    --gold:        #f59e0b;
    --ink:         #0f172a;
    --ink-2:       #1e293b;
    --ink-3:       #475569;
    --ink-4:       #94a3b8;
    --surface:     #ffffff;
    --surface-2:   #f8fafc;
    --surface-3:   #f1f5f9;
    --border:      #e2e8f0;
    --border-2:    #cbd5e1;
    --radius:      8px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.07);
    --shadow:      0 2px 10px rgba(0,0,0,.09);
    --shadow-md:   0 6px 24px rgba(0,0,0,.10);
    --shadow-lg:   0 12px 40px rgba(0,0,0,.13);
    --font:        'Inter', -apple-system, sans-serif;
    --trans:       0.18s ease;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }

/* =========================================
   CONTAINER
   ========================================= */

.pd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.pd-main {
    padding-top: 20px;
    padding-bottom: 60px;
}

/* =========================================
   BREADCRUMB
   ========================================= */

.pd-breadcrumb {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 9px 0;
    font-size: 12.5px;
}

.pd-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    color: var(--ink-4);
}

.pd-breadcrumb a {
    color: var(--blue);
    font-weight: 500;
}

.pd-breadcrumb a:hover { text-decoration: underline; }

/* =========================================
   HERO LAYOUT
   ========================================= */

.pd-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-bottom: 40px;
}

/* =========================================
   IMAGE GALLERY
   ========================================= */

.pd-gallery__main {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.pd-gallery__main:hover .pd-main-img {
    transform: scale(1.04);
}

.pd-discount-ribbon {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 6px;
    z-index: 2;
    letter-spacing: .02em;
}

.pd-gallery__thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pd-thumb {
    width: 68px;
    height: 68px;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    padding: 0;
    transition: all var(--trans);
    flex-shrink: 0;
}

.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pd-thumb:hover { border-color: var(--orange); }
.pd-thumb--active { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(244,129,42,.3); }

/* =========================================
   BUY BOX
   ========================================= */

.pd-buybox {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.pd-buybox__tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.pd-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pd-tag--cat  { background: var(--blue-light); color: var(--blue); }
.pd-tag--hot  { background: var(--orange-light); color: var(--orange-dark); }
.pd-tag--stock { background: var(--green-light); color: var(--green); }

.pd-product-name {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 800;
    color: var(--ink);
    line-height: 1.2;
}

/* Stars */
.pd-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pd-stars { display: flex; gap: 1px; }

.star { font-size: 18px; }
.star--full  { color: var(--gold); }
.star--half  { color: var(--gold); opacity: .6; }
.star--empty { color: var(--border-2); }

.pd-rating__score {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.pd-rating__count {
    font-size: 13px;
    color: var(--ink-4);
}

/* Price */
.pd-price-block { padding: 16px 20px; background: var(--red-light); border-radius: var(--radius-lg); border: 1px solid #fcc; }

.pd-price-main {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--red);
    line-height: 1;
    margin-bottom: 6px;
}

.pd-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pd-price-old {
    font-size: 16px;
    text-decoration: line-through;
    color: var(--ink-4);
}

.pd-price-save {
    font-size: 13px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-light);
    padding: 2px 9px;
    border-radius: 20px;
}

/* Urgency */
.pd-urgency {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-urgency__item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--ink-3);
    padding: 8px 12px;
    background: var(--surface-3);
    border-radius: var(--radius);
}

.pd-urgency__item--red {
    background: var(--red-light);
    color: #8b0000;
}

.pd-urgency__item--red svg { stroke: var(--red); }

.pd-urgency__item strong { color: var(--red); }

/* CTA */
.pd-cta-group {
    display: flex;
    gap: 10px;
}

.pd-btn-buy {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ff7a18, #e63946);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--trans);
    letter-spacing: .01em;
    box-shadow: 0 4px 16px rgba(230,57,70,.35);
}

.pd-btn-buy:hover {
    background: linear-gradient(135deg, #e86a08, #c0392b);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230,57,70,.45);
    color: #fff;
}

.pd-btn-buy:active { transform: translateY(0); }

.pd-btn-wish {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-3);
    cursor: pointer;
    transition: all var(--trans);
    white-space: nowrap;
}

.pd-btn-wish:hover { border-color: var(--red); color: var(--red); }
.pd-btn-wish--active { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* Trust */
.pd-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.pd-trust__item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.pd-trust__item svg { stroke: var(--green); flex-shrink: 0; }

/* =========================================
   BODY GRID (Tabs + Sidebar)
   ========================================= */

.pd-body-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    margin-bottom: 40px;
}

/* Tabs */
.pd-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0;
}

.pd-tab {
    padding: 12px 22px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-4);
    cursor: pointer;
    transition: all var(--trans);
}

.pd-tab:hover { color: var(--ink); }

.pd-tab--active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

.pd-tab-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 28px 30px;
}

/* Description styles */
.pd-description {
    font-size: 15px;
    color: var(--ink-3);
    line-height: 1.85;
}

.pd-description h1, .pd-description h2, .pd-description h3 {
    color: var(--ink);
    font-weight: 700;
    margin: 20px 0 10px;
}

.pd-description h2 { font-size: 1.2rem; }
.pd-description h3 { font-size: 1.05rem; }

.pd-description p { margin-bottom: 14px; }

.pd-description ul, .pd-description ol {
    padding-left: 22px;
    margin-bottom: 14px;
}

.pd-description li { margin-bottom: 5px; }

.pd-description strong { color: var(--ink); font-weight: 700; }

/* Specs table */
.pd-specs-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pd-specs-table th { padding: 10px 14px; background: var(--surface-3); text-align: left; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--border); width: 40%; }
.pd-specs-table td { padding: 10px 14px; color: var(--ink-3); border-bottom: 1px solid var(--border); }
.pd-specs-table tr:last-child th, .pd-specs-table tr:last-child td { border-bottom: none; }

/* Reviews */
.pd-reviews { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.pd-reviews__summary { text-align: center; min-width: 100px; }
.pd-reviews__big { font-size: 3.5rem; font-weight: 800; color: var(--ink); line-height: 1; }
.pd-reviews__count { font-size: 12px; color: var(--ink-4); margin-top: 4px; }
.pd-reviews__bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.pd-rbar { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); }
.pd-rbar__track { flex: 1; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.pd-rbar__fill { height: 100%; background: var(--gold); border-radius: 4px; }

/* =========================================
   SIDEBAR
   ========================================= */

.pd-body-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pd-ad-block {
    background: #f9f9f0;
    border: 1px solid #e0dfc0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 10px;
    gap: 4px;
}

.pd-ad-label {
    font-size: 10px;
    font-family: var(--font);
    color: var(--ink-4);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pd-ad-placeholder {
    width: 280px;
    height: 250px;
    border: 1px dashed #ccc;
    background: #f5f5e8;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    color: #aaa;
    flex-direction: column;
    gap: 4px;
}

.pd-ad-placeholder--wide {
    width: 100%;
    max-width: 728px;
    height: 90px;
    flex-direction: row;
}

/* Alert Box */
.pd-alert-box {
    background: var(--blue-light);
    border: 1px solid #c7d9f5;
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
}

.pd-alert-box__icon { font-size: 24px; margin-bottom: 6px; }

.pd-alert-box h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 4px;
}

.pd-alert-box p { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; }

.pd-email-inp {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #c7d9f5;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--ink);
    background: var(--surface);
    outline: none;
    margin-bottom: 7px;
}

.pd-alert-btn {
    width: 100%;
    padding: 9px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--trans);
}

.pd-alert-btn:hover { background: #1345c0; }

/* =========================================
   RELATED PRODUCTS
   ========================================= */

.pd-related { margin-bottom: 32px; }

.pd-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.pd-section-head h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ink);
}

.pd-section-head a {
    font-size: 13px;
    color: var(--blue);
    font-weight: 600;
}

.pd-section-head a:hover { text-decoration: underline; }

.pd-related__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.pd-rel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--trans);
    position: relative;
    display: block;
}

.pd-rel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--orange);
}

.pd-rel-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 1;
}

.pd-rel-card__img { aspect-ratio: 1/1; overflow: hidden; }
.pd-rel-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.pd-rel-card:hover .pd-rel-card__img img { transform: scale(1.06); }

.pd-rel-card__info { padding: 12px; }

.pd-rel-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
    line-height: 1.4;
}

.pd-rel-card__price {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.pd-rel-new {
    font-size: 15px;
    font-weight: 800;
    color: var(--red);
}

.pd-rel-old {
    font-size: 12px;
    text-decoration: line-through;
    color: var(--ink-4);
}

.pd-rel-cta {
    font-size: 12px;
    font-weight: 700;
    color: var(--orange);
    display: block;
}

/* =========================================
   BOTTOM AD
   ========================================= */

.pd-ad-leaderboard {
    background: #f9f9f0;
    border: 1px solid #e0dfc0;
    padding: 8px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    border-radius: var(--radius);
}

/* =========================================
   NOT FOUND
   ========================================= */

.pd-not-found {
    max-width: 480px;
    margin: 80px auto;
    text-align: center;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.pd-not-found h2 { font-size: 1.4rem; margin-bottom: 12px; }
.pd-not-found a { color: var(--blue); font-weight: 600; }

/* =========================================
   RESPONSIVE — TABLET ≤900px
   ========================================= */

@media (max-width: 900px) {
    .pd-hero { grid-template-columns: 1fr; gap: 24px; }
    .pd-body-grid { grid-template-columns: 1fr; }
    .pd-body-sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .pd-related__grid { grid-template-columns: repeat(2, 1fr); }
    .pd-gallery__main { aspect-ratio: 16/10; }
}

/* =========================================
   RESPONSIVE — MOBILE ≤600px
   ========================================= */

@media (max-width: 600px) {
    .pd-main { padding-top: 14px; padding-bottom: 40px; }
    .pd-price-main { font-size: 1.9rem; }
    .pd-product-name { font-size: 1.2rem; }
    .pd-btn-buy { font-size: 15px; padding: 14px 18px; }
    .pd-trust { grid-template-columns: 1fr 1fr; gap: 6px; }
    .pd-tab { padding: 10px 14px; font-size: 13px; }
    .pd-tab-content { padding: 20px 16px; }
    .pd-related__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .pd-body-sidebar { grid-template-columns: 1fr; }
    .pd-hero { gap: 18px; }
    .pd-gallery__main { aspect-ratio: 1/1; }
}