/**
 * Packages page — OSMDentis ticket grid.
 * Loaded on pages that contain the [osm_packages] shortcode.
 * v2 — flex-based, defensive against parent overflow.
 */

.osm-packages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 16px 80px;
    box-sizing: border-box;
}

@media (min-width: 960px) {
    .osm-packages-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 28px;
    }
}

/* ══════════════════════════════════════
   Ticket card — flex layout for reliability
   ══════════════════════════════════════ */
.osm-ticket {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(135deg, rgba(102,155,188,0.10) 0%, rgba(102,155,188,0.02) 60%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 20px 60px rgba(0,0,0,0.30), 0 8px 24px rgba(255,255,255,0.04);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.osm-ticket::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22px;
    right: 22px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
    pointer-events: none;
    z-index: 2;
}

.osm-ticket:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 24px 80px rgba(0,0,0,0.35), 0 12px 30px rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.30);
}

/* ── Left side — main info (flexible) ── */
.osm-ticket-main {
    flex: 1 1 0%;
    min-width: 0;
    padding: 24px 24px 22px;
    border-right: none;
    border-bottom: 1.5px dashed rgba(255,255,255,0.20);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.osm-ticket-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.osm-ticket-brand {
    font-size: 10px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: #669bbc;
    font-weight: 700;
    white-space: nowrap;
}

.osm-ticket-num {
    font-family: "SF Mono", ui-monospace, "Menlo", "Consolas", monospace;
    font-size: 10px;
    color: rgba(255,255,255,0.40);
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.osm-ticket-name {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0 0 4px;
    line-height: 1.1;
    color: #fff;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.osm-ticket-tag {
    font-size: 11px;
    color: rgba(255,255,255,0.42);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin: 0 0 20px;
    font-weight: 500;
}

.osm-ticket-includes-label {
    font-size: 9px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.40);
    margin-bottom: 12px;
    font-weight: 600;
}

.osm-ticket-includes-content {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.osm-ticket-includes-content ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.osm-ticket-includes-content ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.66);
    line-height: 1.45;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

.osm-ticket-includes-content ul li::before {
    content: '\2713';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    background: rgba(102,155,188,0.18);
    color: #669bbc;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.osm-ticket-includes-content p {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    margin: 0 0 8px;
    line-height: 1.5;
}

/* ── Right side — stub with price + CTA ── */
.osm-ticket-stub {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 22px 16px 22px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    text-align: center;
    background: rgba(0,0,0,0.24);
    gap: 14px;
    box-sizing: border-box;
    overflow: hidden;
}

.osm-ticket-stub-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.osm-ticket-stub-label {
    font-size: 9px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.42);
    font-weight: 600;
}

.osm-ticket-stub-price {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #fff;
    display: block;
    font-variant-numeric: tabular-nums;
    margin-top: 8px;
    word-break: keep-all;
    white-space: nowrap;
    text-shadow: 0 2px 16px rgba(102,155,188,0.38);
}

.osm-ticket-stub-price .woocommerce-Price-amount {
    font-size: inherit !important;
    color: #fff;
    font-weight: 600;
}

.osm-ticket-stub-price .woocommerce-Price-currencySymbol {
    font-size: 17px;
    color: rgba(255,255,255,0.55);
    margin-left: 3px;
    font-weight: 400;
}

/* ── CTA (bottom of stub) ── */
.osm-ticket-cta-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.osm-ticket-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 999px;
    background: #669bbc;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osm-ticket-cta::after {
    content: '\2192';
    font-size: 14px;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.osm-ticket-cta:hover:not(.osm-ticket-cta--disabled),
.osm-ticket-cta:focus:not(.osm-ticket-cta--disabled) {
    background: #5688a3;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.28);
    color: #fff !important;
}

.osm-ticket-cta:hover:not(.osm-ticket-cta--disabled)::after,
.osm-ticket-cta:focus:not(.osm-ticket-cta--disabled)::after {
    transform: translateX(3px);
}

.osm-ticket-cta--disabled {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.40) !important;
    cursor: not-allowed;
    opacity: 0.85;
    border: 1px solid rgba(255,255,255,0.08);
}

.osm-ticket-cta--disabled::after {
    display: none;
}

.osm-ticket-cta-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.48);
    margin: 0;
    line-height: 1.4;
    text-align: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0 4px;
}

.osm-ticket-cta-hint a {
    color: #669bbc;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(102,155,188,0.30);
    transition: border-color 0.15s;
}

.osm-ticket-cta-hint a:hover {
    border-bottom-color: #669bbc;
}

/* ── Empty state ── */
.osm-packages-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.60);
    font-size: 15px;
}

.osm-packages-empty-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.42);
    margin-top: 12px;
}

.osm-packages-empty-hint code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #669bbc;
}

/* ── Fix: prevent WPBakery Text Block wrappers from cropping ── */
.wpb_text_column .osm-packages-grid,
.wpb_wrapper .osm-packages-grid {
    max-width: 100%;
}

.wpb_text_column .wpb_wrapper,
.wpb_wrapper > .osm-packages-grid {
    overflow: visible;
}

/* ── Mobile ── */
@media (max-width: 780px) {
    .osm-packages-grid {
        padding: 24px 14px 60px;
        gap: 20px;
    }
    .osm-ticket-name {
        font-size: 22px;
    }
    .osm-ticket-stub-price {
        font-size: 40px;
    }
    .osm-ticket-cta {
        max-width: 260px;
        margin: 0 auto;
    }
}
