/* ══════════════════════════════════════════════════
   ProGuard Product Display — Stylesheet v2.3
   ══════════════════════════════════════════════════ */

:root {
    --pg-primary:      #EA2340;
    --pg-primary-dark: #D91A35;
    --pg-text:         #111827;
    --pg-text-gray:    #6b7280;
    --pg-bg:           #f9fafb;
    --pg-border:       #e5e7eb;
    --pg-radius:       24px;
}
bdi{
    font-weight: 100;
}
/* ── Base ─────────────────────────────────────────── */
.pg-wrap {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    color: var(--pg-text);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    direction: rtl;
    box-sizing: border-box;
}
.pg-wrap * { box-sizing: border-box; }

.pg-error {
    color: #dc2626;
    padding: 20px;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    background: #fef2f2;
}

/* ── Breadcrumb ───────────────────────────────────── */
.pg-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--pg-text-gray);
    font-size: 13px;
    margin-bottom: 30px;
}
.pg-breadcrumb a {
    color: var(--pg-text-gray);
    text-decoration: none;
    transition: color 0.2s;
}
.pg-breadcrumb a:hover { color: var(--pg-primary); }
.pg-breadcrumb span    { color: var(--pg-text-gray); }
.pg-bc-active          { color: var(--pg-text); font-weight: 500; }

/* ── Product Grid ─────────────────────────────────── */
.pg-product-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: start;
}

/* ── Gallery ──────────────────────────────────────── */
.pg-gallery-wrapper {
    position: sticky;
    top: 20px;
}

.pg-main-image-box {
    width: 100%;
    height: 500px;
    background: var(--pg-bg);
    border-radius: var(--pg-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.pg-main-image {
    width: 90%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    transition: transform 0.4s ease;
}
.pg-main-image-box:hover .pg-main-image { transform: scale(1.05); }

.pg-thumbs {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.pg-thumb {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    border: 2px solid transparent;
    background: var(--pg-bg);
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}
.pg-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pg-thumb.active,
.pg-thumb:hover { border-color: var(--pg-primary); transform: translateY(-2px); }

/* ── Product Info ─────────────────────────────────── */
.pg-product-info { padding-top: 10px; }

.pg-badge {
    background: #FFF0F2;
    color: var(--pg-primary);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 100;
    display: inline-block;
    margin-bottom: 15px;
}

.pg-product-title {
    font-size: 28px;
    font-weight: 100;
    line-height: 1.4;
    margin-bottom: 15px;
    color: var(--pg-text);
}

/* ── Rating ───────────────────────────────────────── */
.pg-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    font-size: 14px;
    color: var(--pg-text-gray);
}
.pg-stars  { display: flex; }
.pg-star   { font-size: 18px; }
.pg-filled { color: #F59E0B; }
.pg-empty  { color: #d1d5db; }

/* ── Price ────────────────────────────────────────── */
.pg-price-box {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.pg-price-box .woocommerce-Price-amount {
    font-size: 30px;
    font-weight: 800;
    color: var(--pg-text);
}
.pg-price-box ins { text-decoration: none; }
.pg-price-box del { color: #9ca3af; }
.pg-price-box del .woocommerce-Price-amount {
    font-size: 18px;
    font-weight: 400;
    color: #9ca3af;
}

/* ── Features Grid ────────────────────────────────── */
.pg-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 28px;
}

.pg-feature-item {
    background: var(--pg-bg);
    padding: 15px 10px;
    border-radius: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--pg-text);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.pg-feature-item:hover {
    border-color: var(--pg-border);
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.pg-feature-icon {
    width: 28px;
    height: 28px;
    color: var(--pg-primary);
    flex-shrink: 0;
}

/* ── Short Description ────────────────────────────── */
.pg-short-desc {
    background: var(--pg-bg);
    padding: 15px 20px;
    border-radius: 16px;
    font-size: 14px;
    color: var(--pg-text-gray);
    margin-bottom: 30px;
    line-height: 1.8;
}

/* ══════════════════════════════════════════════════
   ── Coupon Section v2.3 ────────────────────────────
   ══════════════════════════════════════════════════ */

.pg-coupon-wrap {
    margin-bottom: 30px;
}

/* ── Toggle Row (checkbox + label) ─────────────────── */
.pg-coupon-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    width: fit-content;
}

/* Hide the native checkbox completely */
.pg-coupon-checkbox {
    display: none;
}

/* Custom visual checkbox */
.pg-coupon-toggle-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--pg-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* The checkmark SVG tick inside the box */
.pg-coupon-toggle-box svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

/* Checked state */
.pg-coupon-checkbox:checked ~ .pg-coupon-toggle-row .pg-coupon-toggle-box {
    background: var(--pg-text);
    border-color: var(--pg-text);
}

.pg-coupon-checkbox:checked ~ .pg-coupon-toggle-row .pg-coupon-toggle-box svg {
    opacity: 1;
    transform: scale(1);
}

.pg-coupon-toggle-label {
    font-size: 14px;
    color: var(--pg-text-gray);
    transition: color 0.2s;
}

.pg-coupon-toggle-row:hover .pg-coupon-toggle-label {
    color: var(--pg-text);
}

.pg-coupon-toggle-row:hover .pg-coupon-toggle-box {
    border-color: var(--pg-text);
}

/* ── Collapsible Body ───────────────────────────────── */
.pg-coupon-body {
    display: grid;
    grid-template-rows: 0fr;       /* collapsed */
    transition: grid-template-rows 0.35s ease;
    /* overflow: hidden; */
}

/* The inner wrapper is required for the grid trick to work */
.pg-coupon-body-inner {
    overflow: hidden;
}

/* When checkbox is checked, expand */
.pg-coupon-checkbox:checked ~ .pg-coupon-body {
    grid-template-rows: 1fr;       /* expanded */
}

/* The visible card that slides in */
.pg-coupon-card {
    background: #fff;
    border: 1px solid var(--pg-border);
    border-radius: 16px;
    padding: 18px;
    margin-top: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

/* ── Input & Button Row ─────────────────────────────── */
.pg-coupon-row {
    display: flex;
    gap: 10px;
}

.pg-coupon-input {
    flex: 1;
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--pg-border);
    border-radius: 12px;
    background: var(--pg-bg);
    color: var(--pg-text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    min-width: 0; /* Prevents flex overflow */
}

.pg-coupon-input:focus {
    background: #fff;
    border-color: var(--pg-text);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.pg-coupon-input::placeholder {
    color: #9ca3af;
}

.pg-coupon-btn {
    height: 46px;
    padding: 0 22px;
    background-color: var(--pg-text);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 100;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.pg-coupon-btn:hover {
    background-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.pg-coupon-btn:active {
    transform: scale(0.97);
}

/* ── Feedback Message ───────────────────────────────── */
.pg-coupon-msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    font-weight: 500;
}

/* JS should add these classes to .pg-coupon-msg */
.pg-coupon-msg.error   { color: #dc2626; }
.pg-coupon-msg.success { color: #16a34a; }

/* ── Result Card ────────────────────────────────────── */
.pg-coupon-result {
    margin-top: 14px;
    background: #f0fdf4;
    border: 1px dashed #86efac;
    border-radius: 12px;
    padding: 14px;
    animation: pgFadeIn 0.3s ease-out;
}

.pg-coupon-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--pg-text-gray);
}
.pg-coupon-result-row:last-of-type { margin-bottom: 0; }

.pg-coupon-result-val {
    color: var(--pg-text);
    font-weight: 700;
}

.pg-coupon-result-discount .pg-coupon-result-val {
    color: #16a34a;
    font-size: 15px;
}

.pg-coupon-result-final {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #bbf7d0;
}

.pg-coupon-result-final .pg-coupon-result-label {
    font-weight: 100;
    color: var(--pg-text);
}

.pg-coupon-result-final .pg-coupon-result-val {
    font-weight: 900;
    font-size: 18px;
    color: var(--pg-text);
}

/* ── Remove Button ──────────────────────────────────── */
.pg-coupon-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 12px;
    width: 100%;
    margin-top: 12px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 6px;
}

.pg-coupon-remove:hover {
    background: rgba(239, 68, 68, 0.07);
    text-decoration: underline;
}

/* ── Out of Stock ─────────────────────────────────── */
.pg-out-of-stock {
    color: #dc2626;
    font-weight: 100;
    font-size: 16px;
    margin-top: 20px;
}

/* ── Actions ──────────────────────────────────────── */
.pg-actions {
    display: flex;
    gap: 15px;
    height: 56px;
    margin-top: 0;
}

.pg-qty-wrapper {
    background: var(--pg-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 5px;
    width: 140px;
    justify-content: space-between;
    flex-shrink: 0;
}

.pg-qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    color: var(--pg-text);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.pg-qty-btn:hover { background: var(--pg-primary); color: #fff; }

.pg-qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid transparent !important;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    color: var(--pg-text);
}

.pg-add-cart-btn {
    flex: 1;
    border: none;
    background: var(--pg-primary);
    color: #fff;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 100;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(234,35,64,0.3);
    font-family: inherit;
}
.pg-add-cart-btn:hover {
    background: var(--pg-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(234,35,64,0.4);
}
.pg-add-cart-btn.pg-loading {
    opacity: 0.7;
    pointer-events: none;
}
.pg-add-cart-btn.pg-success {
    background: #16a34a;
    box-shadow: 0 8px 25px rgba(22,163,74,0.3);
}

/* ── Tabs ─────────────────────────────────────────── */
.pg-tabs-section { margin-top: 80px; }

.pg-tabs-header {
    display: flex;
    gap: 40px;
    border-bottom: 1px solid var(--pg-border);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.pg-tab-btn {
    padding-bottom: 15px;
    cursor: pointer;
    font-size: 16px;
    color: var(--pg-text-gray);
    position: relative;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
    user-select: none;
}
.pg-tab-btn:hover { color: var(--pg-primary); }
.pg-tab-btn.active { color: var(--pg-text); font-weight: 800; }
.pg-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--pg-primary);
    border-radius: 3px 3px 0 0;
}

.pg-tab-content {
    display: none;
    animation: pgFadeIn 0.4s ease;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.8;
}
.pg-tab-content.active { display: block; }

@keyframes pgFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Spec Rows ────────────────────────────────────── */
.pg-spec-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 20px;
}
.pg-spec-row:last-child { border-bottom: none; }
.pg-spec-label {
    width: 200px;
    flex-shrink: 0;
    color: var(--pg-text-gray);
    font-size: 14px;
}
.pg-spec-val {
    flex: 1;
    color: var(--pg-text);
    font-weight: 500;
    font-size: 14px;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
    .pg-product-grid    { grid-template-columns: 1fr; gap: 30px; }
    .pg-gallery-wrapper { position: relative; top: 0; }
    .pg-main-image-box  { height: 320px; }
    .pg-product-title   { font-size: 22px; }
    .pg-tabs-header     { gap: 20px; }
    .pg-tab-btn         { font-size: 14px; }
    .pg-spec-label      { width: 140px; }
    .pg-features-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .pg-actions       { flex-direction: column; height: auto; gap: 12px; }
    .pg-qty-wrapper   { width: 100%; }
    .pg-add-cart-btn  { height: 54px; }
    .pg-features-grid { grid-template-columns: repeat(2, 1fr); }
    .pg-coupon-btn    { padding: 0 16px; }
}