/* ==========================================================================
   product.css — Product Detail Page
   ========================================================================== */

/* ── Layout ─────────────────────────────────────────────────────────────── */
.pdp-breadcrumb {
    font-size: 0.82rem;
    color: var(--muted);
    padding: 14px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pdp-breadcrumb a { color: var(--muted); text-decoration: none; }
.pdp-breadcrumb a:hover { color: var(--green-700); }
.pdp-breadcrumb span { opacity: 0.5; }

.pdp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
    padding: 28px 0 48px;
}

/* ── Image gallery ──────────────────────────────────────────────────────── */
.pdp-gallery {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pdp-main-image {
    position: relative;
    border-radius: 20px;
    background: #f4fbf4;
    border: 1px solid var(--border);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pdp-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}
.pdp-main-image:hover img { transform: scale(1.04); }

.pdp-badge-wrap {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}
.pdp-badge {
    background: #e53935;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.pdp-badge.green { background: var(--green-700); }

.pdp-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.pdp-thumb {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #f4fbf4;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}
.pdp-thumb:hover,
.pdp-thumb.active { border-color: var(--green-600, #2e7d32); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* ── Product info column ────────────────────────────────────────────────── */
.pdp-info { display: flex; flex-direction: column; gap: 18px; }

.pdp-brand-link {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--green-700);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pdp-brand-link:hover { text-decoration: underline; }

.pdp-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.25;
    color: var(--text);
}

.pdp-short-desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Rating row */
.pdp-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pdp-stars { display: flex; gap: 2px; }
.pdp-stars .star { font-size: 1.05rem; color: #f5a623; }
.pdp-stars .star.empty { color: #d0d0d0; }
.pdp-stars .star.half  { color: #f5a623; opacity: 0.55; }
.pdp-rating-val { font-weight: 700; font-size: 0.95rem; }
.pdp-review-count { color: var(--muted); font-size: 0.85rem; }
.pdp-sold-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--green-100);
    color: var(--green-700);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

/* Price */
.pdp-price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pdp-price {
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--green-700);
}
.pdp-mrp {
    font-size: 1rem;
    color: var(--muted);
    text-decoration: line-through;
}
.pdp-discount {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e53935;
    background: #fce4e4;
    padding: 3px 8px;
    border-radius: 999px;
}
.pdp-tax-note { font-size: 0.78rem; color: var(--muted); }

/* ── Variants ────────────────────────────────────────────────────────────── */
.pdp-variants-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.pdp-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pdp-variant-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 9px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: inherit;
    text-align: center;
}
.pdp-variant-btn .vt-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}
.pdp-variant-btn .vt-price {
    font-size: 0.78rem;
    color: var(--muted);
}
.pdp-variant-btn:hover {
    border-color: var(--green-700);
    background: var(--green-100);
}
.pdp-variant-btn.selected {
    border-color: var(--green-700);
    background: var(--green-100);
}
.pdp-variant-btn.selected .vt-label { color: var(--green-700); }
.pdp-variant-btn:disabled,
.pdp-variant-btn.out-of-stock {
    opacity: 0.45;
    cursor: not-allowed;
    border-style: dashed;
}

/* ── Qty + CTA ───────────────────────────────────────────────────────────── */
.pdp-cta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pdp-qty {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.pdp-qty button {
    width: 38px;
    height: 42px;
    border: none;
    background: #f4fbf4;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--green-700);
    transition: background 0.2s ease;
}
.pdp-qty button:hover { background: var(--green-100); }
.pdp-qty input {
    width: 44px;
    height: 42px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: #fff;
    outline: none;
}
.pdp-add-cart {
    flex: 1;
    min-width: 140px;
    padding: 13px 24px;
    background: var(--green-700);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    font-family: inherit;
}
.pdp-add-cart:hover { background: #1b5e20; transform: translateY(-1px); }
.pdp-buy-now {
    flex: 1;
    min-width: 140px;
    padding: 13px 24px;
    background: #fff;
    color: var(--green-700);
    border: 2px solid var(--green-700);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pdp-buy-now:hover { background: var(--green-700); color: #fff; }

.pdp-stock-note {
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
}
.pdp-stock-note.in-stock { color: #2e7d32; }
.pdp-stock-note.low-stock { color: #e65100; }
.pdp-stock-note.oos { color: #c62828; }

/* ── Technical names ─────────────────────────────────────────────────────── */
.pdp-tech-names {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.6;
}
.pdp-tech-names strong { color: var(--text); }

/* ── Tabs (Description / Specs / Reviews) ───────────────────────────────── */
.pdp-tabs-section { padding: 0 0 60px; }

.pdp-tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.pdp-tab-nav::-webkit-scrollbar { display: none; }

.pdp-tab-btn {
    flex-shrink: 0;
    padding: 13px 22px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}
.pdp-tab-btn:hover { color: var(--text); }
.pdp-tab-btn.active {
    color: var(--green-700);
    border-bottom-color: var(--green-700);
}

.pdp-tab-panel { display: none; padding: 28px 0; }
.pdp-tab-panel.active { display: block; }

/* Description tab */
.pdp-description { line-height: 1.75; color: var(--text); max-width: 760px; }
.pdp-description h2,
.pdp-description h3 { color: var(--green-900); margin-top: 1.4em; }

/* Specifications tab */
.pdp-specs-table {
    width: 100%;
    max-width: 680px;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.pdp-specs-table tr:nth-child(even) td { background: #f4fbf4; }
.pdp-specs-table td {
    padding: 11px 16px;
    border: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}
.pdp-specs-table td:first-child {
    font-weight: 700;
    width: 38%;
    color: var(--green-900);
    white-space: nowrap;
}

/* Reviews tab */
.pdp-reviews-grid { display: flex; flex-direction: column; gap: 18px; max-width: 720px; }
.pdp-review-card {
    background: #f8fff8;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
}
.pdp-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.pdp-reviewer { font-weight: 700; font-size: 0.9rem; }
.pdp-review-date { font-size: 0.78rem; color: var(--muted); }
.pdp-review-stars { display: flex; gap: 2px; }
.pdp-review-stars .star { color: #f5a623; font-size: 0.95rem; }
.pdp-review-text { font-size: 0.88rem; color: var(--text); line-height: 1.65; margin: 0; }

.pdp-review-summary {
    background: linear-gradient(135deg, var(--green-100), #fff);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.pdp-review-big-score {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--green-700);
    line-height: 1;
}
.pdp-review-meta { display: flex; flex-direction: column; gap: 4px; }
.pdp-review-meta .star-row { display: flex; gap: 3px; }
.pdp-review-meta .star-row .star { font-size: 1.1rem; color: #f5a623; }
.pdp-review-meta small { color: var(--muted); font-size: 0.82rem; }

/* Write review form */
.pdp-write-review {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    max-width: 540px;
    margin-top: 28px;
}
.pdp-write-review h3 { margin: 0 0 16px; font-size: 1rem; }
.pdp-wr-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.pdp-wr-row label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.pdp-wr-row input,
.pdp-wr-row textarea,
.pdp-wr-row select {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}
.pdp-wr-row input:focus,
.pdp-wr-row textarea:focus { border-color: var(--green-700); }
.pdp-wr-row textarea { min-height: 90px; resize: vertical; }
.pdp-wr-submit {
    padding: 10px 22px;
    background: var(--green-700);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}
.pdp-no-reviews { color: var(--muted); font-size: 0.9rem; }

/* ── Related products ────────────────────────────────────────────────────── */
.pdp-related { padding: 0 0 60px; }
.pdp-related h2 { margin: 0 0 22px; font-size: 1.3rem; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pdp-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .pdp-gallery { position: static; }
    .pdp-main-image { aspect-ratio: 4 / 3; }
}

@media (max-width: 600px) {
    .pdp-cta-row { flex-direction: column; }
    .pdp-add-cart,
    .pdp-buy-now { width: 100%; min-width: unset; }
    .pdp-tab-btn { padding: 11px 14px; font-size: 0.82rem; }
    .pdp-review-summary { flex-direction: column; align-items: flex-start; gap: 12px; }
    .pdp-review-big-score { font-size: 2.6rem; }
}
