/* ==========================================================================
   THE PRODUCT PAGE FORMAT
   --------------------------------------------------------------------------
   One shell for every product page on wizsolutions.in: Wiz CRM today, WizPOS and
   the service pages as they are rebuilt.

   The rules below came out of the Wiz CRM page, which is the reference. They all
   hang off `body.product-page`, which functions.php adds to any page listed in
   the `wizai_product_pages` filter. Nothing here is specific to the CRM: the
   markup classes are the interface.

   Layout rules, in one place:
     - a .section is full bleed and its content runs to --gutter, so the left and
       right edges line up with the logo and the last nav item;
     - only .section-dark keeps a .content-wrap (1180px, centred);
     - a .section-heading is left aligned on the full measure unless it carries
       .is-centred, in which case the block stays full width and the words centre;
     - rows alternate: picture in one half, words in the other, 88px apart;
     - pictures are real <img> elements at 16:9, never CSS background images, so
       they keep their shape, carry alt text and can be swapped without CSS.

   Markup for a picture row:

     <div class="service-grid">
       <article class="service-card service-card--image">
         <figure class="card-shot"><img src="…" alt="…" width="1600" height="900" loading="lazy" decoding="async"></figure>
         <div class="card-copy">
           <h3><i class="bi bi-people" aria-hidden="true"></i>Contacts And Companies</h3>
           <p>…</p>
         </div>
       </article>
       …
     </div>

   Markup for a media row (a section with words and one picture):

     <div class="media-row">            (add .is-flipped to put the picture first)
       <div class="media-copy"> …paragraph, list… </div>
       <figure class="media-shot"><img …></figure>
     </div>

   Markup for the FAQ is produced by template-parts/product-faq.php.
   ========================================================================== */

/* --------------------------------------------------------------- rows --- */
.product-page .service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(48px, 8vw, 112px);
}

.product-page .service-grid .service-card::before {
    background-image: none;
    content: none;
}

/* The `:nth-child(n)` is load bearing: it out-ranks the theme's even-row rule
   (`padding-right: calc(50% + 44px)`), which otherwise squeezes every second row
   into the left half. */
.product-page .service-offer-page .service-grid .service-card.service-card--image:nth-child(n) {
    display: grid;
    grid-template-columns: calc(50% - 44px) minmax(0, 1fr);
    column-gap: 88px;
    align-items: center;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.product-page .service-card--image .card-shot {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
}

.product-page .service-card--image .card-shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    /* A half-width 16:9 picture is 500px tall on a wide screen; the cap keeps a
       row near the 360px the theme uses. Below the cap nothing is cropped. */
    max-height: clamp(260px, 27vw, 400px);
    border-radius: 24px;
    object-fit: cover;
    background: var(--surface-2);
    box-shadow: var(--shadow);
}

.product-page .service-card--image .card-copy {
    grid-column: 2;
    grid-row: 1;
}

.product-page .service-card--image:nth-child(even) .card-shot {
    grid-column: 2;
}

.product-page .service-card--image:nth-child(even) .card-copy {
    grid-column: 1;
}

.product-page .service-card h3 {
    display: flex;
    gap: 10px;
    align-items: center;
}

.product-page .service-card h3 i {
    color: var(--cobalt);
    font-size: 1.05em;
    line-height: 1;
}

.product-page .service-card p {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .product-page .service-offer-page .service-grid .service-card.service-card--image:nth-child(n) {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 18px;
    }

    .product-page .service-card--image .card-shot,
    .product-page .service-card--image:nth-child(even) .card-shot {
        grid-column: 1;
        grid-row: 1;
    }

    .product-page .service-card--image .card-copy,
    .product-page .service-card--image:nth-child(even) .card-copy {
        grid-column: 1;
        grid-row: 2;
    }

    .product-page .service-card--image .card-shot img {
        max-height: none;
    }
}

/* ---------------------------------------------------------- media rows --- */
.product-page .media-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    column-gap: 88px;
    align-items: center;
}

.product-page .media-row.is-flipped .media-shot {
    order: -1;
}

.product-page .media-shot {
    margin: 0;
}

.product-page .media-shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: clamp(260px, 27vw, 400px);
    border-radius: 24px;
    object-fit: cover;
    background: var(--surface-2);
    box-shadow: var(--shadow);
}

@media (max-width: 900px) {
    .product-page .media-row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 20px;
    }

    .product-page .media-row.is-flipped .media-shot {
        order: 0;
    }

    .product-page .media-shot img {
        max-height: none;
    }
}

/* ----------------------------------------------------------------- FAQ --- */
.product-page .faq-list {
    border-top: 1px solid var(--line);
}

.product-page .faq-item {
    border-bottom: 1px solid var(--line);
}

.product-page .faq-item summary {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    list-style: none;
    transition: color 160ms ease;
}

.product-page .faq-item summary::-webkit-details-marker {
    display: none;
}

.product-page .faq-item summary:hover,
.product-page .faq-item[open] summary {
    color: var(--accent);
}

.product-page .faq-toggle {
    position: relative;
    flex: none;
    width: 15px;
    height: 15px;
}

.product-page .faq-toggle::before,
.product-page .faq-toggle::after {
    position: absolute;
    inset: 0;
    margin: auto;
    background: var(--accent);
    content: "";
}

.product-page .faq-toggle::before {
    width: 15px;
    height: 2px;
}

.product-page .faq-toggle::after {
    width: 2px;
    height: 15px;
    transition: transform 180ms ease;
}

.product-page .faq-item[open] .faq-toggle::after {
    transform: scaleY(0);
}

.product-page .faq-a {
    padding: 0 44px 26px 0;
}

.product-page .faq-a p {
    max-width: 980px;
    margin: 0;
    color: var(--muted);
}

.product-page .faq-more {
    margin: 26px 0 0;
    color: var(--muted);
}

.product-page .faq-more a {
    color: var(--accent);
    font-weight: 600;
}

/* ------------------------------------------------- headings and copy ---- */
/* A centred heading keeps the full measure; only the words centre, so the block
   still lines up with the nav bar. */
.product-page .section-heading.is-centred {
    text-align: center;
}

.product-page .section-heading.is-centred h2 {
    max-width: 880px;
    margin-inline: auto;
}

.product-page .section-copy {
    max-width: 820px;
    margin: 0 0 8px;
}

.product-page .plain-list {
    display: grid;
    gap: 14px;
    max-width: 720px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.product-page .plain-list li {
    position: relative;
    padding-left: 28px;
    color: var(--muted);
}

.product-page .plain-list li::before {
    position: absolute;
    top: 0.5em;
    left: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--cobalt));
    content: "";
}

.product-page .plain-list strong {
    color: var(--ink);
}

/* A closing note under a grid: centred on a readable measure. */
.product-page .after-list {
    max-width: 720px;
    margin: 28px auto 0;
    text-align: center;
    line-height: 1.65;
    color: var(--muted);
}

/* --------------------------------------------------------------- plans --- */
.product-page .plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.product-page .plan-card {
    display: flex;
    flex-direction: column;
    padding: 28px 24px 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--white);
}

.product-page .plan-card.is-featured {
    border-color: var(--cobalt);
    box-shadow: 0 24px 50px rgba(0, 87, 216, 0.16);
    transform: translateY(-6px);
}

.product-page .plan-badge {
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.product-page .plan-card.is-featured .plan-badge {
    background: var(--cobalt);
    color: var(--white);
}

.product-page .plan-card h3 {
    margin: 0 0 4px;
    font-size: 1.3rem;
}

.product-page .plan-tagline {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.98rem;
}

.product-page .plan-price {
    margin-bottom: 4px;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.product-page .plan-price small {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
}

.product-page .plan-seats {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

.product-page .plan-features {
    display: grid;
    gap: 10px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.95rem;
}

.product-page .plan-features li {
    position: relative;
    padding-left: 24px;
}

.product-page .plan-features li::before {
    position: absolute;
    top: 0.15em;
    left: 0;
    color: var(--cobalt);
    font-weight: 800;
    content: "\2713";
}

.product-page .plan-card .button {
    align-self: flex-start;
    margin-top: auto;
}

.product-page .plan-notes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 26px;
    color: var(--muted);
    font-size: 0.9rem;
}

.product-page .licence-note {
    max-width: 720px;
    margin-top: 26px;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--cobalt);
    border-radius: 14px;
    background: var(--white);
    color: var(--muted);
}

/* --------------------------------------------------------------- roles --- */
.product-page .role-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 32px;
}

.product-page .role-list div {
    padding: 26px 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--white);
}

.product-page .role-list strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.6rem;
    color: var(--cobalt);
}

.product-page .role-list span {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-page .role-list p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 900px) {
    .product-page .plan-grid,
    .product-page .plan-notes,
    .product-page .role-list {
        grid-template-columns: 1fr;
    }

    .product-page .plan-card.is-featured {
        transform: none;
    }
}

/* ------------------------------------------------------- info cards --- */
/*
 * For content that is a set of short facts rather than a row with a photograph:
 * "what every package includes", "what the licence covers", "who it is for".
 *
 * Distinct from .service-card, which is a full width row holding a picture. The
 * card styling matches .role-list and .plan-card on purpose - same border, same
 * radius, same white panel - so a page that uses both does not look like two
 * different sites.
 *
 * Six cards fill a 3 x 2 grid exactly. Five leave a gap on the last row, which
 * always reads as an accident, so write six or make it four.
 *
 * Markup:
 *   <div class="info-grid">
 *     <article class="info-card">
 *       <i class="bi bi-receipt" aria-hidden="true"></i>
 *       <h3>Counter billing</h3>
 *       <p>...</p>
 *     </article>
 *   </div>
 */
.product-page .info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 34px;
}

.product-page .info-card {
    padding: 26px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--white);
}

.product-page .info-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--cobalt);
    font-size: 1.15rem;
    line-height: 1;
}

.product-page .info-card h3 {
    margin: 0 0 8px;
    font-size: 1.08rem;
    line-height: 1.3;
}

.product-page .info-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.97rem;
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .product-page .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .product-page .info-grid {
        grid-template-columns: 1fr;
    }
}
