/**
 * WM School Photos – Order form styles.
 *
 * Migrated from: Student Order Forms.css (order form section only).
 *
 * Removed from this file:
 * - Family search styles (now in family-search.css)
 * - Secure download button styles (now in secure-download.css)
 * - Page-specific .elementor-element-aa8ed05 selector (move to theme/Elementor custom CSS)
 * - Image display classes (.student_portrait_cls, .class_photo_cls, .teacher_portrait_cls)
 *   — those are presentation concerns that belong in theme CSS, not plugin CSS.
 * - WooCommerce block button overrides (.wc-block-components-button) — theme CSS.
 */

/* ── Order form container ─────────────────────────────────────────────────── */
.sowc-order {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.sowc-group {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
}

.sowc-group label {
    font-size: 13px;
}

.sowc-legend {
    font-size: 12pt;
    font-weight: 600;
    margin-bottom: 4px;
}

.sowc-order .sowc-sublegend {
    margin: 0.5rem 0 0;
    font-weight: 600;
    font-size: 10pt;
}

/* ── Row layout (label + qty input) ───────────────────────────────────────── */
.sowc-row {
    display: grid;
    grid-template-columns: 1fr 55px;
    gap: 0.75rem;
    align-items: center;
    margin: 0.15rem 0;
}

@media (max-width: 720px) {
    .sowc-row {
        grid-template-columns: 1fr 45px;
    }
}

/* ── Checkbox items ───────────────────────────────────────────────────────── */
.sowc-check {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    margin: 0.35rem 0;
}

/* ── Subtotal ─────────────────────────────────────────────────────────────── */
.sowc-subtotal {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border-top: 1px dashed #ddd;
    margin-top: 10px;
    padding-top: 10px;
}

.sowc-order .sowc-subtotal .val,
.sowc-subtotal-only {
    font-weight: bold;
}

/* ── Order summary ([student_subtotal]) ─────────────────────────────────────── */
/* Elementor / themes often set .elementor-shortcode > * { display:block; width:100% }
   which overrides flex and forces the button below the pricing block. */
.elementor-shortcode .sowc-order-summary,
.sowc-order-summary {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0;
    --sowc-summary-bar-height: 2.5rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    z-index: 100;
}

/* Expandable breakdown panel (above the bar) */
.sowc-order-summary .sowc-summary-details {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 0;
    padding: 0.65rem 0.75rem 0.75rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    max-height: min(70vh, 320px);
    overflow-y: auto;
    text-align: left;
    z-index: 101;
}

.sowc-order-summary .sowc-summary-details[aria-hidden="true"] {
    pointer-events: none;
}

.sowc-order-summary .sowc-summary-details > .sowc-subtotal:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* Single-row collapsed bar */
.sowc-order-summary .sowc-summary-bar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    min-height: var(--sowc-summary-bar-height);
    width: 100%;
    box-sizing: border-box;
}

.sowc-order-summary .sowc-summary-toggle {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.35rem 0.4rem 0.35rem 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.25;
    cursor: pointer;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    white-space: nowrap;
}

.sowc-order-summary .sowc-bar-label {
    flex-shrink: 0;
    font-weight: 600;
}

.sowc-order-summary .sowc-bar-total {
    flex-shrink: 0;
    font-weight: 700;
}

.sowc-order-summary .sowc-toggle-chevron {
    display: inline-block;
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1;
    margin-left: 0.15rem;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.sowc-order-summary.sowc-summary--open .sowc-toggle-chevron {
    transform: rotate(180deg);
}

.sowc-order-summary .sowc-free-shipping-note--bar {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.2;
}

.sowc-order-summary .sowc-free-shipping-note--details {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    line-height: 1.3;
}

.sowc-order-summary .sowc-bar-divider {
    flex-shrink: 0;
    align-self: stretch;
    width: 0;
    margin: 0.15rem 0.15rem 0.15rem 0.25rem;
    border-left: 1px dashed #ddd;
}

.sowc-order-summary .sowc-checkout-btn {
    flex-shrink: 0;
    align-self: center;
    padding: 0.45rem 0.65rem;
    margin-left: 0;
    font-size: 0.8125rem;
    line-height: 1.25;
    border-radius: 8px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .elementor-shortcode .sowc-order-summary,
    .sowc-order-summary {
        position: static;
        bottom: auto;
        background: transparent;
        border-top: 0;
        padding: 0;
        box-shadow: none;
        z-index: auto;
    }

    .sowc-order-summary .sowc-summary-details {
        bottom: calc(100% + 0.35rem);
        padding: 0.5rem 0.6rem 0.65rem;
    }

    .sowc-order-summary .sowc-summary-toggle {
        font-size: 0.75rem;
        padding: 0.3rem 0.35rem 0.3rem 0;
    }

    .sowc-order-summary .sowc-free-shipping-note--bar {
        display: none !important;
    }

    .sowc-order-summary .sowc-free-shipping-note--details {
        font-size: 0.625rem;
    }

    .sowc-order-summary .sowc-checkout-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 48%;
        min-height: 3rem;
        padding: 0.7rem 0.95rem;
        font-size: 0.8125rem;
        line-height: 1.1;
    }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.sowc-btn {
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-weight: 600;
}

.sowc-btn.add {
    background: #3d3b39;
    color: #fff;
}

.sowc-btn.add:hover {
    background: #8C8C8C;
    color: #fff;
}

/* ── Quantity inputs ──────────────────────────────────────────────────────── */
input[type=number].sowc-qty {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.1rem 0.5rem;
    text-align: center;
    line-height: 17px;
    font-size: 11pt;
}

/* ── Notes / descriptions ─────────────────────────────────────────────────── */
.sowc-note {
    font-size: 0.9rem;
    color: #666;
}

.sowc-description {
    font-size: 9pt;
}

.sowc-note-field {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    font-size: 1rem;
    width: 100%;
}

/* ── Per-item prices ──────────────────────────────────────────────────────── */
.sowc-order .sowc-price {
    font-size: 9pt;
    font-weight: 400;
    color: #3f5563;
    margin-left: 0.1rem;
}

/* ── Loading overlay: see common.css ───────────────────────────────────── */

/* ── Student info in cart ─────────────────────────────────────────────────── */
.wm-student {
    color: #666;
}
