/* ==========================================================================
   ZARGHOON JEWELLERS - Price details & refreshed product UI (Phase 14)
   Loaded after style.css/responsive.css (see includes/price-details.php),
   so these rules refine the existing product card and product page
   without editing those files. Uses the brand variables from style.css.
   ========================================================================== */

:root {
    --pd-gold-grad: linear-gradient(135deg, #C9A45C 0%, #B08A4A 45%, #8f6f39 100%);
    --pd-sale: #2f7a45;
    --pd-sale-bg: #e8f3ec;
    --pd-shadow-hover: 0 18px 40px rgba(143, 111, 57, 0.16);
}

/* ---------------------------------------------------------------------
   Product card
   --------------------------------------------------------------------- */
.product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(176, 138, 74, 0.18);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(17, 17, 17, 0.03);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(176, 138, 74, 0.45);
    box-shadow: var(--pd-shadow-hover);
}

.product-card-media {
    background: radial-gradient(circle at 50% 40%, #fbf8f3 0%, var(--card) 100%);
}

.product-card-purity {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--pd-gold-grad);
    color: var(--white);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 10px rgba(143, 111, 57, 0.3);
    transition: opacity var(--ease-normal);
}

/* Hide the purity chip while the Quick View bar slides into its place. */
.product-card-media:hover .product-card-purity {
    opacity: 0;
}

.product-card-badges {
    align-items: flex-start;
}

.badge {
    font-weight: 500;
    box-shadow: 0 3px 8px rgba(17, 17, 17, 0.12);
}

.badge-sale {
    background-color: var(--pd-sale);
}

.product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 16px 18px;
    text-align: left;
}

.product-card-name {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-card-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin: 0 0 14px;
    background-color: rgba(176, 138, 74, 0.16);
    border: 1px solid rgba(176, 138, 74, 0.16);
    border-radius: 10px;
    overflow: hidden;
}

.product-card-specs div {
    background-color: #fdfbf8;
    padding: 7px 10px;
    min-width: 0;
}

.product-card-specs dt {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 1px;
}

.product-card-specs dd {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-pricing {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
}

.product-card-was {
    order: 2;
    font-size: 0.82rem;
    color: var(--muted);
}

.product-card-price {
    order: 1;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin: 0;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(176, 138, 74, 0.3);
}

.product-card-footer .stock-badge {
    margin: 0;
    font-size: 0.6rem;
    padding: 3px 9px;
}

.product-card-link {
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--black);
    white-space: nowrap;
    transition: color var(--ease-fast);
}

.product-card-link span {
    display: inline-block;
    transition: transform var(--ease-fast);
}

.product-card-link:hover {
    color: var(--gold-dark);
}

.product-card-link:hover span {
    transform: translateX(3px);
}

/* ---------------------------------------------------------------------
   Product page
   --------------------------------------------------------------------- */
.product-gallery-main {
    border-radius: 18px;
    border: 1px solid rgba(176, 138, 74, 0.18);
    background: radial-gradient(circle at 50% 40%, #fbf8f3 0%, var(--card) 100%);
}

.product-info h1 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    margin-bottom: 4px;
}

.product-sku {
    margin-bottom: 18px;
}

.pd-price-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 22px;
}

.pd-price-head .product-price {
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
    font-weight: 700;
    color: var(--gold-dark);
    margin: 0;
    line-height: 1.1;
}

.pd-was {
    flex-basis: 100%;
    font-size: 1rem;
    color: var(--muted);
}

.pd-save {
    padding: 5px 12px;
    border-radius: 20px;
    background-color: var(--pd-sale-bg);
    color: var(--pd-sale);
    font-size: 0.78rem;
    font-weight: 600;
}

.pd-price-head .stock-badge {
    margin: 0;
}

.pd-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.pd-fact {
    padding: 12px 12px 10px;
    border: 1px solid rgba(176, 138, 74, 0.22);
    border-radius: 12px;
    background-color: var(--white);
    text-align: center;
}

.pd-fact span {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 3px;
}

.pd-fact strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--black);
}

.pd-breakdown {
    position: relative;
    padding: 20px 22px 16px;
    margin-bottom: 18px;
    border-radius: 16px;
    background-color: var(--white);
    border: 1px solid rgba(176, 138, 74, 0.28);
    box-shadow: 0 10px 30px rgba(143, 111, 57, 0.08);
    overflow: hidden;
}

.pd-breakdown::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--pd-gold-grad);
}

.pd-breakdown-title {
    font-size: 1.05rem;
    margin: 4px 0 12px;
}

.pd-breakdown dl {
    margin: 0;
}

.pd-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.92rem;
}

.pd-row dt {
    color: var(--text);
}

.pd-row dt small {
    display: block;
    font-size: 0.74rem;
    color: var(--muted);
}

.pd-row dd {
    margin: 0;
    font-weight: 500;
    color: var(--black);
    white-space: nowrap;
}

.pd-row-sub dt,
.pd-row-sub dd {
    color: var(--muted);
}

.pd-row-discount dt,
.pd-row-discount dd {
    color: var(--pd-sale);
    font-weight: 600;
}

/* The row just above the total drops its rule so the total's gold rule
   isn't doubled. */
.pd-breakdown dl > .pd-row:nth-last-child(2) {
    border-bottom: none;
}

.pd-row-total {
    border-bottom: none;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 2px solid rgba(176, 138, 74, 0.35);
}

.pd-row-total dt {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--black);
}

.pd-row-total dd {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gold-dark);
}

.pd-breakdown .product-price-disclaimer {
    margin: 10px 0 0;
}

.pd-taxonomy {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 14px;
}

.pd-taxonomy a {
    color: var(--gold-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Product page buttons: rounder, gold primary. */
.product-actions .btn {
    border-radius: 999px;
}

.product-actions .btn-primary {
    background: var(--pd-gold-grad);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(143, 111, 57, 0.28);
}

.product-actions .btn-primary:hover {
    background: var(--black);
    border-color: var(--black);
}

.product-actions .product-qty-input {
    border-radius: 999px;
    text-align: center;
}

.product-actions .product-cart-form .btn {
    flex: 1;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .pd-facts {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* On touch screens Quick View sits permanently where the purity chip
   would be (see responsive.css), so the chip is hidden there. */
@media (max-width: 768px) {
    .product-card-purity {
        display: none;
    }
}

@media (max-width: 700px) {
    .product-card-body {
        padding: 12px 12px 14px;
    }

    .product-card-name {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    /* Two cards per row leaves too little width for a 2x2 grid, so the
       details become a one-column list: label left, value right. */
    .product-card-specs {
        grid-template-columns: 1fr;
        background-color: transparent;
        border: none;
        border-radius: 0;
        gap: 0;
        margin-bottom: 10px;
    }

    .product-card-specs div {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 6px;
        padding: 4px 0;
        background-color: transparent;
        border-bottom: 1px solid rgba(176, 138, 74, 0.14);
    }

    .product-card-specs div:last-child {
        border-bottom: none;
    }

    .product-card-specs dt {
        font-size: 0.6rem;
        letter-spacing: 0.04em;
        margin: 0;
        white-space: nowrap;
    }

    .product-card-specs dd {
        font-size: 0.72rem;
        overflow: visible;
    }

    .product-card-price {
        font-size: 1.1rem;
    }

    .product-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .pd-breakdown {
        padding: 18px 16px 14px;
    }
}

/* Gold rate label: "Gold Rate ... Rs. 36,000/g" on wide cards,
   "Rate/g ... Rs. 36,000" on narrow phone cards. */
.product-card-specs .spec-short {
    display: none;
}

@media (max-width: 700px) {
    .product-card-specs .spec-long {
        display: none;
    }

    .product-card-specs .spec-short {
        display: inline;
    }
}
