/* ============================================================
   Block: commercial  (capability accordion — alt surface)
   Mirrors the medical-affairs styling 1:1 (eyebrow, heading, sub,
   accordion summary, icon, body, arrow, detail panel, detail-block,
   responsive breakpoints) but keeps the .commercial-section scope
   and the section's lightgrey surface so it can sit between two
   white sections without blending into them.
   ============================================================ */

.commercial-section {
    padding: 75px 0;
    background-color: var(--wp--preset--color--lightgrey, #f7f7f7);
    color: var(--wp--preset--color--foreground);
}

.commercial-section .caprows-inner {
    position: relative;
}

/* ---- Eyebrow / heading / sub (matches medical-affairs) ---- */

.commercial-section .cap-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--wp--preset--color--secondary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px !important;
    text-transform: uppercase;
    line-height: 1;
}

.commercial-section .cap-eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--wp--preset--color--secondary);
    flex-shrink: 0;
    display: none;
}

.commercial-section .cap-heading {
    margin: 0 0 14px;
    color: var(--wp--preset--color--foreground);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.01em;
    max-width: 960px;
}

.commercial-section .cap-heading-accent {
    color: var(--wp--preset--color--primary);
}

.commercial-section .cap-sub {
    margin: 15px 0 36px !important;
    max-width: 820px;
    color: var(--wp--preset--color--foreground);
    font-size: 18px !important;
    line-height: 1.5 !important;
}

/* Expand-all / Collapse-all toolbar — matches medical-affairs */
.commercial-section .cap-controls {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    margin: 0 0 14px;
}

.commercial-section .cap-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--wp--preset--color--primary);
    padding: 9px 18px;
    border-radius: 999px;
    color: var(--wp--preset--color--primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    line-height: 1;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

@media (min-width: 992px) {
    .commercial-section .cap-control-btn:hover {
    background-color: var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
    outline: none;
    box-shadow: 0 6px 18px -8px rgba(16, 157, 219, 0.55);
}
}

.commercial-section .cap-control-btn:active {
    transform: translateY(1px);
}

/* Pill-button icon — circle-arrow SVG mask. Inherits currentColor. */
.commercial-section .cap-control-btn-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
    transition: transform 0.2s ease;
}

.commercial-section .cap-control-btn[data-action="expand"]   .cap-control-btn-icon { transform: rotate(90deg); }
.commercial-section .cap-control-btn[data-action="collapse"] .cap-control-btn-icon { transform: rotate(-90deg); }

@media (max-width: 600px) {
    .commercial-section .cap-controls { justify-content: flex-start; gap: 14px; }
}

/* ---- Accordion (matches medical-affairs) ---- */

.commercial-section .caprows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.commercial-section .caprow {
    border: 1px solid var(--wp--preset--color--grey, #efefef);
    border-radius: 12px;
    background-color: var(--wp--preset--color--background);
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.commercial-section .caprow[open] {
    box-shadow: 0 12px 32px -22px rgba(0, 30, 80, 0.25);
    border-color: var(--wp--preset--color--primary);
}

.commercial-section .caprow > summary {
    list-style: none;
    cursor: pointer;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 30px;
    transition: background-color 0.2s ease;
}

/* .commercial-section .caprow > summary:hover {
    background-color: rgba(16, 157, 219, 0.04);
} */

.commercial-section .caprow > summary::-webkit-details-marker { display: none; }

.commercial-section .caprow-icon {
    flex-shrink: 0;
    width: 75px;
    height: 51px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wp--preset--color--secondary);   /* pink — drives inline-SVG currentColor */
    /* background-color: rgba(17, 158, 219, 0.1); */
    border-radius: 10px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* .commercial-section .caprow[open] .caprow-icon {
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
} */

/* Inlined uploaded SVG icons — strokes inherit currentColor from
   .caprow-icon (pink at rest, white when open). */
.commercial-section .caprow-icon svg {
    width: 75px;
    height: 75px;
    display: block;
}

.commercial-section .caprow-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.commercial-section .caprow-title {
    font-size: 18px;
    font-weight: 700;
    color: black;
    line-height: 1.3;
}

.commercial-section .caprow-sub {
    font-size: 14px;
    color: var(--wp--preset--color--foreground);
    /* opacity: 0.7; */
    line-height: 1.4;
}

.commercial-section .caprow-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: var(--wp--preset--color--primary);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 72 72' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 72 72' fill='none'><circle cx='32' cy='32' r='30.5' stroke='black' stroke-width='3'/><path d='M25 18L43 32.6124L25 47' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    -webkit-mask-repeat:   no-repeat;
            mask-repeat:   no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size:     contain;
            mask-size:     contain;
    transition: transform 0.3s ease;
    transform: rotate(90deg);   /* closed: point DOWN */
}

.commercial-section .caprow[open] .caprow-arrow {
    transform: rotate(-90deg);  /* open: point UP */
}

/* Drawer animation is driven by blocks/commercial/view.js (same
   script as medical-affairs). We just need overflow:hidden on the
   drawer so max-height clipping animates cleanly. */
.commercial-section .caprow-detail {
    overflow: hidden;
    padding:  0 33px 0 33px;
    background-color: rgba(17, 158, 219, 0.1);
    border-top: 1px solid var(--wp--preset--color--grey, #efefef);
}

.commercial-section .caprow-detail-intro {
    margin: 0 0 22px;
    color: var(--wp--preset--color--foreground);
    font-size: 18px;
    line-height: 1.5;
    padding-top: 33px;
}

.commercial-section .caprow-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-bottom: 33px;
}

.commercial-section .caprow-detail-block {
    background-color: var(--wp--preset--color--background);
    border: 1px solid var(--wp--preset--color--grey, #efefef);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow:
        0 14px 32px -12px rgba(5, 22, 60, 0.40),
        inset 0  1px 0 0 rgba(255, 255, 255, 0.55),
        inset 1px 0  0 0 rgba(255, 255, 255, 0.30),
        inset -1px 0 0 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.10);
    border-top: 8px solid #d02db0;
}

.commercial-section .dlabel {
    display: inline-block;
    margin: 0 0 13px;
    color: black;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
}

.commercial-section .caprow-detail-block p {
    margin: 0;
    color: var(--wp--preset--color--foreground);
    font-size: 16px;
    line-height: 1.5;
}

.commercial-section.alignfull,
.wp-block-pixacore-commercial.alignfull {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* ---- Responsive (matches medical-affairs breakpoints) ---- */

@media (max-width: 900px) {
    .commercial-section .caprow-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .commercial-section { padding: 64px 0; }
    .commercial-section .caprow > summary { padding: 16px 16px; gap: 12px; }
    .commercial-section .caprow-icon { width: 60px; height: 32px; border-radius: 8px; }
    .commercial-section .caprow-title { font-size: 15px; }
    .commercial-section .caprow-detail { padding: 4px 16px 18px; }
}
