/* ===== Product Hero Section ===== */
.ph-hero {
    --ph-border: #e8e8e8;
    --ph-buy-bg: #fafafa;
    --ph-red: #dc2626;
    --ph-muted: #6b7280;
    --ph-text: #111827;
    --ph-blue: #2563eb;
    display: grid;
    grid-template-columns: 1.4fr 0.9fr 1.1fr;
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    color: var(--ph-text);
    line-height: 1.5;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.ph-col {
    padding: 28px 24px;
    min-width: 0;
}

.ph-col + .ph-col {
    border-inline-start: 1px solid var(--ph-border);
}

/* ---------- Column 1: Gallery ---------- */
.ph-gallery {
    position: relative;
}

.ph-real-badge {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 2;
    background: #fff;
    border: 1px solid var(--ph-border);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--ph-muted);
    white-space: nowrap;
}

.ph-wishlist-top {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 1px solid var(--ph-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: #9ca3af;
    transition: color .15s ease, background .15s ease;
}

.ph-wishlist-top:hover {
    color: var(--ph-red);
    background: #fef2f2;
}

.ph-main-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    aspect-ratio: 1 / 1.1;
    border-radius: 8px;
    overflow: hidden;
}

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

.ph-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--ph-border);
    background: #fff;
    color: #374151;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    transition: background .15s ease;
}

.ph-nav:hover {
    background: #f3f4f6;
}

.ph-nav-prev {
    inset-inline-start: 12px;
}

.ph-nav-next {
    inset-inline-end: 12px;
}

.ph-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.ph-thumb {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border: 1px solid var(--ph-border);
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease;
}

.ph-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ph-thumb.is-active {
    border-color: var(--ph-red);
}

.ph-indicator {
    margin-top: 12px;
    font-size: 12px;
    color: var(--ph-muted);
    text-align: center;
}

/* ---------- Column 2: Info ---------- */
.ph-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px;
    color: var(--ph-text);
}

.ph-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--ph-text);
}

.ph-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 16px;
    letter-spacing: 1px;
}

.ph-stars .on { color: #f59e0b; }
.ph-stars .off { color: #d1d5db; }

.ph-rating-value { font-weight: 700; }

.ph-rating-count { color: var(--ph-muted); }

.ph-id {
    font-size: 12px;
    color: var(--ph-muted);
    margin-bottom: 16px;
}

.ph-tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.ph-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.ph-tag-label {
    color: var(--ph-muted);
    flex: 0 0 auto;
    min-width: 72px;
}

.ph-tag-value {
    font-weight: 600;
    color: var(--ph-text);
    background: #f3f4f6;
    padding: 3px 10px;
}

.ph-desc {
    font-size: 14px;
    color: var(--ph-muted);
    line-height: 1.9;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ph-more {
    display: inline-block;
    font-size: 14px;
    color: var(--ph-blue);
    text-decoration: none;
}

.ph-more:hover {
    text-decoration: underline;
}

/* ---------- Column 3: Buy ---------- */
.ph-buy {
    background: var(--ph-buy-bg);
    position: relative;
    display: flex;
    flex-direction: column;
}

.ph-discount {
    position: absolute;
    top: 18px;
    inset-inline-start: 20px;
    z-index: 2;
    background: #2e7d32;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    padding: 4px 10px;
}

.ph-old-price {
    display: block;
    font-size: 14px;
    color: var(--ph-muted);
    text-decoration: line-through;
    margin-top: 26px;
}

.ph-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--ph-red);
    margin: 4px 0 12px;
}

.ph-price .unit {
    font-size: 15px;
    font-weight: 600;
}

.ph-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #16a34a;
    font-weight: 600;
    margin-bottom: 16px;
}

.ph-stock .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
}

.ph-stock.is-out {
    color: var(--ph-red);
}

.ph-stock.is-out .dot {
    background: var(--ph-red);
}

.ph-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--ph-border);
    border-radius: 8px;
    width: max-content;
    overflow: hidden;
    margin-bottom: 14px;
    background: #fff;
}

.ph-qty button {
    width: 38px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #374151;
    cursor: pointer;
    line-height: 1;
}

.ph-qty button:hover { background: #f3f4f6; }

.ph-qty input {
    width: 48px;
    height: 40px;
    border: none;
    border-inline: 1px solid var(--ph-border);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    background: #fff;
    outline: none;
}

.ph-cart-form { margin-bottom: 12px; }

.ph-add-cart {
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    line-height: 1;
    background: var(--ph-red);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.ph-add-cart:hover { background: #b91c1c; }

.ph-add-cart:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ph-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.ph-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    border: 1px solid var(--ph-border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.ph-action:hover {
    border-color: var(--ph-blue);
    color: var(--ph-blue);
}

.ph-min-qty {
    font-size: 12px;
    color: var(--ph-muted);
    margin-bottom: 18px;
}

.ph-trust {
    border-top: 1px solid var(--ph-border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.ph-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #374151;
}

.ph-trust-item svg {
    width: 18px;
    height: 18px;
    color: var(--ph-blue);
    flex: 0 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
    .ph-hero {
        grid-template-columns: 1fr;
    }

    .ph-col + .ph-col {
        border-inline-start: 0;
        border-top: 1px solid var(--ph-border);
    }

    .ph-title { font-size: 20px; }
}

/* ===== Volume variant tiles ===== */
.ph-variant {
    margin-bottom: 14px;
}

.ph-variant-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ph-text);
}

.ph-variant-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ph-variant-tile {
    position: relative;
    overflow: hidden;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ph-text);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.ph-variant-tile:hover {
    border-color: #dc2626;
    background: #fff5f5;
}

.ph-variant-tile.selected {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

/* Unavailable (no saleable variant) */
.ph-variant-tile.is-unavailable {
    opacity: .4;
    cursor: not-allowed;
}

.ph-variant-tile.is-unavailable::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dc2626;
    transform: rotate(-45deg);
}

.ph-variant-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--ph-red);
}

/* ---------- Volume tiles: mobile (full width) ---------- */
@media (max-width: 640px) {
    .ph-variant-tiles {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ph-variant-tile {
        text-align: center;
        padding: 10px 8px;
    }
}

/* ===== Click-to-zoom lightbox ===== */
.ph-main-image [data-role="main"] {
    cursor: zoom-in;
}

.ph-zoom {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ph-zoom[hidden] {
    display: none;
}

.ph-zoom-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    cursor: zoom-out;
}

.ph-zoom-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    -webkit-user-drag: none;
    user-select: none;
}

.ph-zoom-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 46px;
    height: 46px;
    min-width: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.85);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    transition: background 0.15s ease, transform 0.15s ease;
}

.ph-zoom-close:hover {
    background: #c0392b;
    transform: scale(1.08);
}

.ph-zoom-close:active {
    transform: scale(0.96);
}

.ph-zoom-close:focus-visible {
    outline: 3px solid #f5b301;
    outline-offset: 2px;
}
