.swtm-calendar-wrap,
.swtm-selector-wrap,
.swtm-my-tickets-wrap {
    max-width: 960px;
    margin: 2rem auto;
    padding: 1rem;
}

.swtm-my-tickets-wrap h3{
    color: #fff !important;
}

.swtm-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
    border-radius: .35rem;
}

.swtm-calendar-header h2 {
    margin: 0;
    text-align: center;
}

.swtm-month-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    text-decoration: none;
    background: #f1f5f9;
    color: #111827;
    font-size: 1.4rem;
    line-height: 1;
}


.swtm-month-nav-disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

.swtm-selected-date,
.swtm-available-count {
    margin: 0 0 1rem;
    text-align: center;
}

.swtm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .65rem;
}

.swtm-calendar-grid>* {
    min-width: 0;
}

.swtm-weekdays {
    margin-bottom: .65rem;
    font-weight: 700;
    text-align: center;
    color: #00647a;
}

.swtm-weekdays>div {
    padding: .35rem 0;
}

/* Important: the form must not create an extra visual box inside the CSS grid. */
.swtm-day-form {
    display: contents;
    margin: 0;
}

.swtm-day {
    box-sizing: border-box;
    min-height: 98px;
    width: 100%;
    border-radius: 14px;
    padding: .8rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .5rem;
    border: 1px solid #e5e7eb;
    font: inherit;
    text-align: left;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
}

button.swtm-day {
    cursor: pointer;
}

.swtm-available {
    background-color: #dcfce7 !important;
    color: #4e6e33 !important;
    border-color: #86efac !important;
    margin: 0 !important;
    text-align: left !important;
    border-radius: 14px !important;
}

button.swtm-available:hover,
a.swtm-available:hover {
    background-color: #4e6e33 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Keep unavailable days calm. Red border/text is enough; full red blocks make the whole calendar look broken. */
.swtm-soldout {
    display: block;
    background: #f8fafc !important;
    color: #991b1b;
    border-color: #fecaca;
    cursor: not-allowed;
    opacity: .9;
    padding: 14px 16px;
}


.swtm-closed {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
    opacity: .78;
}

.swtm-day-stock.closed {
    background: rgba(255,255,255,.65);
    color: #64748b;
}

.swtm-past {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.swtm-day-stock.past {
    background: rgba(241, 245, 249, 0.9);
    color: #64748b;
}

.swtm-empty {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.swtm-day-number {
    font-size: 1.25rem;
    font-weight: 800;
}

.swtm-day-stock {
    display: flex;
    text-wrap: wrap;
    text-align: center;
    letter-spacing: 1.4px;
    justify-content: center;
    margin-top: 10px;
    padding: .22rem .45rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .7);
    color: #4e6e33;
}

.swtm-soldout .swtm-day-stock {
    color: #991b1b;
}

.swtm-ticket-form {
    display: grid;
    gap: 1rem;
}

.swtm-ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.swtm-ticket-info {
    display: grid;
    gap: .25rem;
}

.swtm-ticket-info small {
    color: #64748b;
}

.swtm-ticket-qty input {
    width: 90px;
    padding: .5rem;
    margin-top: 8px;
}

.woocommerce-checkout-review-order-table td.product-name {
    position: relative;
}

.swtm-checkout-remove {
    position: absolute;
    right: 5px;
    top: 20px;
    transform: translateY(-50%);
    display: inline-flex;
    margin-bottom: 10px;
    color: #991b1b !important;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none !important;
    margin-left: auto;
    white-space: nowrap;
}

.swtm-trash-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 28px;
    margin-top: -2px;
}

.swtm-checkout-remove:hover {
    color: #7f1d1d;
    text-decoration: underline;
}

.swtm-buy-button,
.swtm-print-button {
    display: inline-block;
    border: 0 !important;
    border-radius: 999px;
    padding: .9rem 1.5rem;
    cursor: pointer;
    background-color: #4e6e33 !important;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}

.swtm-buy-button:hover,
.swtm-print-button:hover {
    background-color: #00647a !important;
}

.swtm-error {
    padding: 1rem;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
}

.swtm-ticket-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.swtm-ticket-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    break-inside: avoid;
}

.swtm-ticket-card img {
    max-width: 180px;
    height: auto;
}

.swtm-qr-missing {
    display: none;
}

/* MY ACCOUNT BUTTON/MENU */

.sw-account-dropdown {
    position: relative;
    display: inline-block;
}

/* THIS is the fix */
.sw-account-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 12px;
    /* hover bridge */
}

.sw-account-toggle,
.sw-account-login {
    border: 0;
    border-radius: 999px !important;
    padding: 10px 16px;
    background: #00647a !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.sw-account-toggle:hover {
    background-color: #00647a !important;
    color: #fff !important;
}

.sw-account-login:hover {
    background-color: #fff !important;
    color: #00647a !important;
}

.sw-account-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 180px;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);

    z-index: 9999;

    display: flex;
    flex-direction: column;
}

.sw-account-menu {
    opacity: 0;
    pointer-events: none;
}

.sw-account-menu a {
    display: block;
    /* important */
    width: 100%;
    padding: 4px 14px;
    color: #111827;
    text-decoration: none;
}

.sw-account-dropdown:hover .sw-account-menu,
.sw-account-dropdown:focus-within .sw-account-menu {
    opacity: 1;
    pointer-events: auto;
}

.sw-account-dropdown:hover .sw-account-menu,
.sw-account-dropdown:focus-within .sw-account-menu {
    display: block;
}

/* MY ACCOUNT PAGE */
.swtm-account-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.swtm-account-card {
    display: block;
    padding: 20px;
    border-radius: 16px;
    background-color: #00647a;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.swtm-account-card:hover {
    transform: translateY(-2px);
    color: #fff !important;
}

.swtm-account-card strong,
.swtm-account-card span {
    display: block;
}

.swtm-account-card strong {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.woocommerce-MyAccount-navigation-link--downloads,
.woocommerce-notices-wrapper {
    display: none;
}

.swtm-ticket-qr {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
    margin: 1rem auto 0;
    background: #fff;
    padding: .5rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.swtm-order-group {
    margin: 1.5rem 0 2rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #f8fafc;
}

.swtm-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.swtm-order-header h3 {
    color: #000 !important;
    margin: 0 0 .4rem;
}

.swtm-order-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.swtm-ticket-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .5rem;
}

.swtm-ticket-topline h4 {
    margin: 0;
}

.swtm-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.swtm-status-valid {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}

.swtm-status-used {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.swtm-ticket-used {
    opacity: .72;
    background: #f8fafc;
}

.swtm-ticket-used .swtm-ticket-qr {
    filter: grayscale(1);
}

.swtm-print-body {
    background: #fff;
    padding: 20px;
}

.swtm-print-body .swtm-order-group {
    border: 0;
    background: #fff;
    padding: 0;
}

.swtm-print-body .swtm-print-button {
    display: none !important;
}

.swtm-ticket-list {
    grid-template-columns: 1fr;
}

.swtm-ticket-card.swtm-ticket-horizontal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.swtm-ticket-main {
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.swtm-ticket-brand-row {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.swtm-ticket-logo {
    width: 148px;
    object-fit: contain;
    background: #fff;
    padding: .35rem;
}

.swtm-ticket-logo-fallback {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1d4ed8;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
}

.swtm-ticket-brand-row h4 {
    margin: 0;
    font-size: 1.2rem;
}

.swtm-ticket-subtitle {
    display: block;
    color: #64748b;
    font-size: .9rem;
    margin-top: .15rem;
}

.swtm-ticket-type-line {
    border-left: 4px solid #1d4ed8;
    padding-left: .75rem;
}

.swtm-ticket-type-line span {
    display: block;
    color: #64748b;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
}

.swtm-ticket-type-line strong {
    display: block;
    margin-top: .12rem;
    font-size: 1.45rem;
    line-height: 1.15;
    color: #0f172a;
}

.swtm-ticket-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem 1rem;
}

.swtm-ticket-details-grid p,
.swtm-ticket-used-at {
    margin: 0;
}

.swtm-ticket-details-grid strong {
    color: #475569;
}

.swtm-ticket-qr-box {
    min-width: 220px;
    padding: 1rem;
    background: #f8fafc;
    border-left: 1px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.swtm-ticket-qr-box .swtm-ticket-qr {
    width: 190px;
    max-width: 190px;
    margin: 0;
}

.swtm-ticket-qr-box small {
    margin-top: .55rem;
    color: #64748b;
    font-weight: 700;
}

.swtm-qr-placeholder {
    width: 150px;
    min-height: 150px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: #fff;
    color: #64748b;
    font-size: .75rem;
    word-break: break-word;
}

@media (max-width: 640px) {
    .sw-account-toggle,
    .sw-account-login {
        margin-top:0 !important;
    }

    .swtm-order-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .swtm-calendar-grid {
        gap: .35rem;
    }

    .swtm-day {
        min-height: 74px;
        padding: .2rem !important;
        border-radius: 4px !important;
        text-align: center !important;
    }

    .swtm-day-number {
        font-size: 1rem;
        text-align: center;
    }

    .swtm-ticket-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .swtm-day-stock {
        padding: .1rem;
        text-wrap: wrap;
        font-size: 0.5rem;
        letter-spacing: 0.03rem;
        text-align: center;
        border-radius: 2px;
    }

    .swtm-available {
        padding: 2px;
        text-align: center;
    }

    .swtm-soldout {
        padding: 12px 2px !important;
    }
}

@media (max-width: 700px) {
    .swtm-ticket-card.swtm-ticket-horizontal {
        grid-template-columns: minmax(0, 1fr) 105px !important;
        gap: .5rem;
    }

    .swtm-ticket-main {
        padding: .75rem;
        gap: .55rem;
    }

    .swtm-ticket-brand-row {
        gap: .5rem;
    }

    .swtm-ticket-logo {
        width: 82px;
        max-width: 82px;
    }

    .swtm-ticket-brand-row h4 {
        font-size: .65rem;
    }

    .swtm-ticket-subtitle {
        font-size: .60rem;
    }

    .swtm-ticket-type-line {
        padding-left: .5rem;
    }

    .swtm-ticket-type-line strong {
        font-size: 1rem;
    }

    .swtm-ticket-details-grid {
        gap: .25rem;
        font-size: .55rem;
    }

    .swtm-ticket-qr-box {
        min-width: 105px;
        width: 105px;
        padding: .45rem;
        border-left: 1px dashed #cbd5e1;
        border-top: 0;
    }

    .swtm-ticket-qr-box .swtm-ticket-qr {
        width: 88px;
        max-width: 88px;
    }

    .swtm-ticket-qr-box small {
        font-size: .65rem;
        line-height: 1.1;
    }

    .swtm-status-badge {
        font-size: .65rem;
        padding: .18rem .4rem;
    }
}

@media print {
    body:not(.swtm-print-body) .site-header,
    body:not(.swtm-print-body) .site-footer,
    body:not(.swtm-print-body) header,
    body:not(.swtm-print-body) footer,
    body:not(.swtm-print-body) nav,
    body:not(.swtm-print-body) .swtm-print-button {
        display: none !important;
    }

    .swtm-order-group {
        break-inside: avoid;
        border: 0;
        background: #fff;
    }

    .swtm-ticket-card.swtm-ticket-horizontal {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 180px !important;
        gap: 1rem !important;
        box-shadow: none !important;
        border: 1px solid #111 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .swtm-ticket-main {
        padding: 1rem !important;
    }

    .swtm-ticket-qr-box {
        min-width: 180px !important;
        width: 180px !important;
        border-left: 1px dashed #cbd5e1 !important;
        border-top: 0 !important;
        padding: .75rem !important;
    }

    .swtm-ticket-qr-box .swtm-ticket-qr {
        width: 150px !important;
        max-width: 150px !important;
    }

    .swtm-ticket-qr-box {
        background: #fff;
    }

    .swtm-print-button {
        display: none;
    }

    .swtm-ticket-card {
        box-shadow: none;
    }
}
/* Mobile calendar status: keep the day number readable and replace long labels with icons. */
@media (max-width: 640px) {
    .swtm-weekdays {
        gap: .25rem;
        font-size: .72rem;
    }

    .swtm-days {
        gap: .28rem;
    }

    .swtm-day {
        min-height: 58px !important;
        padding: .35rem .15rem !important;
        align-items: center;
        justify-content: center;
        gap: .18rem;
        line-height: 1;
    }

    .swtm-day-number {
        display: block;
        font-size: .98rem;
        line-height: 1;
    }

    .swtm-day-stock {
        width: auto;
        min-width: 0;
        margin-top: .18rem;
        padding: 0;
        border-radius: 0;
        background: transparent !important;
        font-size: 0;
        line-height: 1;
        letter-spacing: 0;
    }

    .swtm-day-stock::before {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        border-radius: 999px;
        background: #fff;
        font-size: 12px;
        font-weight: 900;
        line-height: 1;
        padding-top: 2px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
    }

    .swtm-available .swtm-day-stock::before {
        content: "✓";
        color: #16a34a;
    }

    .swtm-past .swtm-day-stock::before,
    .swtm-closed .swtm-day-stock::before,
    .swtm-soldout .swtm-day-stock::before {
        content: "⊘";
        color: #dc2626;
    }

    .swtm-soldout {
        display: flex !important;
        padding: .35rem .15rem !important;
    }
}
