/* layout */
body.woocommerce,
body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-account,
body.single-tribe_events,                 /* single event page */
body.post-type-archive-tribe_events,      /* events archive */
body.tribe-events-view                    /* TEC views wrapper */ {
    min-height: 100vh !important;
}

.entry .entry-content .event-tickets .tribe-tickets__tickets-item,
.event-tickets .tribe-tickets__tickets-item {
    padding: 12px 0 12px !important;
}

/* fix event page width */
body.single-tribe_events .tribe-events-single,
body.single-tribe_events .tribe-tickets__tickets-form {
    max-width: 1024px;
    margin-inline: auto;
    padding-inline: 16px;
}

/* fix update tickets page width */
.tribe-events-pg-template {
    width: 100% !important;
}

.tribe-events-single-section.tribe-events-event-meta.primary,
.tribe-events-single-section.tribe-events-event-meta.secondary {
    flex-grow: 1;
}

.tribe-tickets__tickets-title {
    margin-bottom: 18px !important;
}

.tribe-link-view-attendee {
    margin: 0 0 10px;
    padding: 12px !important;
    border: 2px solid #eb3f2f !important;
    border-radius: 10em !important;
}

.tribe-link-view-attendee a,
.tribe-back a {
    color: var(--tec-color-accent-primary) !important;
}

.tribe-link-view-attendee a:hover,
.tribe-back a:hover {
    text-decoration: underline !important;
}

.woocommerce .woocommerce-customer-details .woocommerce-column__title {
    margin-top: 64px;
}

/* buttons */

.tribe-common-c-btn,
.tribe-common-c-btn-border,
.tribe-tickets__tickets-buy,
.woocommerce .button,
.woocommerce button,
.woocommerce .button.alt {
    background-color: var(--e-global-color-primary) !important;
    fill: var(--e-global-color-35a525f) !important;
    color: var(--e-global-color-35a525f) !important;
    border-radius: 30px !important;
    border: none !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    transition:
        background-color 0.2s ease,
        color 0.2s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
}

/* hover */
.tribe-common-c-btn:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover,
.tribe-common-c-btn-border:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover,
.tribe-tickets__tickets-buy:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover,
.woocommerce .button:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover,
.woocommerce button:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover,
.woocommerce .button.alt:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover {
    background-color: var(--e-global-color-text) !important;
    color: #fff !important;
    cursor: pointer !important;
}

.tribe-common a.tribe-common-c-btn--small:active,
.tribe-common a.tribe-common-c-btn--small:disabled,
.tribe-common a.tribe-common-c-btn--small:focus,
.tribe-common a.tribe-common-c-btn--small:hover,
.tribe-common button.tribe-common-c-btn--small:active,
.tribe-common button.tribe-common-c-btn--small:disabled,
.tribe-common button.tribe-common-c-btn--small:focus,
.tribe-common button.tribe-common-c-btn--small:hover,
.tribe-common input[type="button"].tribe-common-c-btn--small:active,
.tribe-common input[type="button"].tribe-common-c-btn--small:disabled,
.tribe-common input[type="button"].tribe-common-c-btn--small:focus,
.tribe-common input[type="button"].tribe-common-c-btn--small:hover,
.tribe-common input[type="submit"].tribe-common-c-btn--small:active,
.tribe-common input[type="submit"].tribe-common-c-btn--small:disabled,
.tribe-common input[type="submit"].tribe-common-c-btn--small:focus,
.tribe-common input[type="submit"].tribe-common-c-btn--small:hover {
    padding: 11px 20px !important;
}

/* tribe events "subscribe" dropdown ghost button */
.tribe-events-c-subscribe-dropdown__button {
    background-color: transparent !important;
    color: var(--e-global-color-primary) !important;
    border: 2px solid var(--e-global-color-primary) !important;
    border-radius: 30px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease !important;
}

/* hover/focus ghost */
.tribe-events-c-subscribe-dropdown__button:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover,
.tribe-events-c-subscribe-dropdown__button:not(:disabled):not(.disabled):not([aria-disabled="true"]):focus {
    background-color: var(--e-global-color-primary) !important;
    color: var(--e-global-color-35a525f) !important;
    border-color: var(--e-global-color-primary) !important;
    cursor: pointer !important;
}

/* disabled states: keep it ghost, just fade */
.tribe-events-c-subscribe-dropdown__button:disabled,
.tribe-events-c-subscribe-dropdown__button.disabled,
.tribe-events-c-subscribe-dropdown__button[aria-disabled="true"] {
    background-color: transparent !important;
    color: var(--e-global-color-primary) !important;
    border-color: var(--e-global-color-primary) !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/*  WooCommerce main action buttons (Apply, Place Order, etc) */
.wc-block-components-button.contained,
.wc-block-components-button.contained:focus,
.wc-block-components-button.contained:active {
    background-color: var(--e-global-color-primary) !important;
    fill: var(--e-global-color-35a525f) !important;
    color: var(--e-global-color-35a525f) !important;
    border-radius: 30px !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 12px 28px !important;
    transition:
        background-color 0.2s ease,
        color 0.2s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center;
}

/* hover (no hover when disabled) */
.wc-block-components-button.contained:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover {
    background-color: var(--e-global-color-text) !important;
    cursor: pointer !important;
    color: #fff !important;
}

.wc-block-components-button__text,
.wc-block-components-checkout-place-order-button__text {
    color: inherit !important;
    fill: inherit !important;
}

.wp-block-woocommerce-checkout-actions-block
    .wc-block-checkout__actions_row
    .wc-block-components-checkout-place-order-button
    .wc-block-components-checkout-place-order-button__text {
    display: inline-block !important;
}

/* disabled */
.tribe-common-c-btn:disabled,
.tribe-common-c-btn-border:disabled,
.tribe-tickets__tickets-buy:disabled,
.tribe-events-c-subscribe-dropdown__button:disabled,
.woocommerce .button:disabled,
.woocommerce button:disabled,
.woocommerce .button.alt:disabled,
.wc-block-components-button.contained:disabled,
.wc-block-components-checkout-place-order-button.contained:disabled,
.tribe-common-c-btn.disabled,
.tribe-common-c-btn-border.disabled,
.tribe-tickets__tickets-buy.disabled,
.tribe-events-c-subscribe-dropdown__button.disabled,
.woocommerce .button.disabled,
.woocommerce button.disabled,
.woocommerce .button.alt.disabled,
.wc-block-components-button.contained.disabled,
.wc-block-components-checkout-place-order-button.contained.disabled,
.tribe-common-c-btn[aria-disabled="true"],
.tribe-common-c-btn-border[aria-disabled="true"],
.tribe-tickets__tickets-buy[aria-disabled="true"],
.tribe-events-c-subscribe-dropdown__button[aria-disabled="true"],
.woocommerce .button[aria-disabled="true"],
.woocommerce button[aria-disabled="true"],
.woocommerce .button.alt[aria-disabled="true"],
.wc-block-components-button.contained[aria-disabled="true"],
.wc-block-components-checkout-place-order-button.contained[aria-disabled="true"] {
    color: #fff !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* disable hover effects when disabled (hard stop) */
.tribe-common-c-btn:disabled:hover,
.tribe-common-c-btn-border:disabled:hover,
.tribe-tickets__tickets-buy:disabled:hover,
.tribe-events-c-subscribe-dropdown__button:disabled:hover,
.woocommerce .button:disabled:hover,
.woocommerce button:disabled:hover,
.woocommerce .button.alt:disabled:hover,
.wc-block-components-button.contained:disabled:hover,
.wc-block-components-checkout-place-order-button.contained:disabled:hover,
.tribe-common-c-btn.disabled:hover,
.tribe-common-c-btn-border.disabled:hover,
.tribe-tickets__tickets-buy.disabled:hover,
.tribe-events-c-subscribe-dropdown__button.disabled:hover,
.woocommerce .button.disabled:hover,
.woocommerce button.disabled:hover,
.woocommerce .button.alt.disabled:hover,
.wc-block-components-button.contained.disabled:hover,
.wc-block-components-checkout-place-order-button.contained.disabled:hover,
.tribe-common-c-btn[aria-disabled="true"]:hover,
.tribe-common-c-btn-border[aria-disabled="true"]:hover,
.tribe-tickets__tickets-buy[aria-disabled="true"]:hover,
.tribe-events-c-subscribe-dropdown__button[aria-disabled="true"]:hover,
.woocommerce .button[aria-disabled="true"]:hover,
.woocommerce button[aria-disabled="true"]:hover,
.woocommerce .button.alt[aria-disabled="true"]:hover,
.wc-block-components-button.contained[aria-disabled="true"]:hover,
.wc-block-components-checkout-place-order-button.contained[aria-disabled="true"]:hover {
    color: #fff !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* global disabled opacity */
button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* modals */

.tribe-common div.tribe-dialog {
    z-index: 1000 !important;
}

/* sticky footer for woo + events pages using body as grid */
html,
body {
    height: 100%;
}

body.woocommerce,
body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-account,
body.single-tribe_events,
body.post-type-archive-tribe_events,
body.tribe-events-view {
    min-height: 100vh !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important; /* header | main | footer */
}

/* header row */
body.woocommerce .elementor-location-header,
body.single-tribe_events .elementor-location-header,
body.post-type-archive-tribe_events .elementor-location-header,
body.tribe-events-view .elementor-location-header {
    grid-row: 1 !important;
}

/* main/content row: cover common containers */
body.woocommerce #content,
body.woocommerce .site-main,
body.woocommerce .entry-content,
body.woocommerce .elementor-location-single,
body.single-tribe_events #content,
body.single-tribe_events .site-main,
body.single-tribe_events .entry-content,
body.single-tribe_events .elementor-location-single,
body.post-type-archive-tribe_events #content,
body.post-type-archive-tribe_events .site-main,
body.post-type-archive-tribe_events .entry-content,
body.post-type-archive-tribe_events .elementor-location-single,
body.tribe-events-view #content,
body.tribe-events-view .site-main,
body.tribe-events-view .entry-content,
body.tribe-events-view .elementor-location-single {
    grid-row: 2 !important;
}

/* footer row */
body.woocommerce .elementor-location-footer,
body.single-tribe_events .elementor-location-footer,
body.post-type-archive-tribe_events .elementor-location-footer,
body.tribe-events-view .elementor-location-footer {
    grid-row: 3 !important;
    margin-top: 0 !important; /* kill theme gaps */
}

/* remove bottom margins that can create white gaps on short pages */
body.woocommerce .entry-content > :last-child,
body.single-tribe_events .entry-content > :last-child {
    margin-bottom: 0 !important;
}

/* cart link base */
#ptc-nav-cart.menu-cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    padding: 8px 12px;
    border-radius: 24px;
}

/* svg icon */
#ptc-nav-cart .ptc-cart-icon {
    width: 30px;
    height: 30px;
    fill: var(--tec-color-accent-primary);
    display: inline-block;
}

#ptc-nav-cart.menu-cart-link:hover .ptc-cart-icon {
    opacity: 0.7;
}

#ptc-nav-cart.menu-cart-link:active .ptc-cart-icon {
    opacity: 0.9;
}

/* count badge */
#ptc-nav-cart .ptc-cart-count {
    position: absolute;
    background: var(--e-global-color-text);
    color: #fff;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    right: 0;
    top: 0;
}

/* cart block width + padding */
.page-content [data-block-name="woocommerce/cart"],
.entry-content [data-block-name="woocommerce/cart"],
.elementor-location-single [data-block-name="woocommerce/cart"] {
    max-width: 1024px;
    margin-inline: auto;
    padding-inline: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* prevent overflow from flex/grid children */
.wc-block-components-sidebar-layout,
.wc-block-cart,
.wc-block-cart__contents,
.wc-block-cart .wc-block-components-main,
.wc-block-cart .wc-block-components-sidebar,
.wc-block-cart .wc-block-cart-items,
.wc-block-cart .wc-block-cart__totals {
    min-width: 0 !important;
}

/* make long names/images wrap instead of stretching layout */
.wc-block-cart .wc-block-cart-items td,
.wc-block-cart .wc-block-cart-items th {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.wc-block-cart .wc-block-cart-item__image img {
    max-width: 100%;
    height: auto;
}

/* coupon row/input sizing */
.wc-block-components-totals-coupon__form,
.wc-block-components-text-input input {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* notices and last-resort overflow control */
.woocommerce-notices-wrapper {
    overflow-x: auto;
}

body.woocommerce-cart {
    overflow-x: clip;
}
/* empty cart page icon */
.wc-block-cart__empty-cart__title.with-empty-cart-icon:before {
    background-color: currentColor;
    opacity: 0.25;
    content: "";
    display: block;
    height: 5em;
    margin: 0 auto 2em;
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'><path d='M24 48C10.7 48 0 58.7 0 72C0 85.3 10.7 96 24 96L69.3 96C73.2 96 76.5 98.8 77.2 102.6L129.3 388.9C135.5 423.1 165.3 448 200.1 448L456 448C469.3 448 480 437.3 480 424C480 410.7 469.3 400 456 400L200.1 400C188.5 400 178.6 391.7 176.5 380.3L171.4 352L475 352C505.8 352 532.2 330.1 537.9 299.8L568.9 133.9C572.6 114.2 557.5 96 537.4 96L124.7 96L124.3 94C119.5 67.4 96.3 48 69.2 48L24 48zM208 576C234.5 576 256 554.5 256 528C256 501.5 234.5 480 208 480C181.5 480 160 501.5 160 528C160 554.5 181.5 576 208 576zM432 576C458.5 576 480 554.5 480 528C480 501.5 458.5 480 432 480C405.5 480 384 501.5 384 528C384 554.5 405.5 576 432 576z'/></svg>") !important;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: 5em;
    width: 5em;
}

/*  fix sticky "Ticket Summary" position on attendee-registration page */
@media (min-width: 960px) {
    body.page-tribe-attendee-registration .event-tickets .tribe-tickets__mini-cart,
    body.page-tribe-attendee-registration .tribe-common .tribe-tickets__mini-cart {
        top: 168px !important;
    }
}

/* fix sticky "Order Summary" position on checkout page */
@container (min-width: 700px) {
    .wc-block-checkout__sidebar {
        top: 168px !important;
    }
}

/* hide "All Events" link on ticket pages */
body.single-tribe_events p.tribe-events-back {
    display: none !important;
}

/* style ticket quantity (or "unlimited" text) on ticket descriptions in list*/
.tribe-common-b3.tribe-tickets__tickets-item-extra-available {
    background: #ffd092;
    padding: 2px 9px;
    border-radius: 5em;
}

/* add border to ticket product images in cart */
.wc-block-cart-item__image img {
    border: 1px solid #d5d5d5;
    border-radius: 5px;
}

/* disable style for ET plus buttons when capped */
.tribe-tickets-quantity-add[disabled],
.tribe-tickets__tickets-item-quantity .plus[disabled] {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* cart proceed disabled */
.wc-block-cart .ptc-disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* cart error messages */
.wc-block-components-notice-banner.is-ptc-error .wc-block-components-notice-banner__content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.wc-block-components-notice-banner.is-ptc-error .wc-block-components-notice-banner__content > svg {
    flex-shrink: 0;
    margin-right: 0.5rem;
    fill: #cc1818;
}
.wc-block-components-notice-banner.is-ptc-error .wc-block-components-notice-banner__content > div {
    flex-grow: 1;
}

/* hide checkout message 'Each attendee specified will receive an email with their individual ticket included'  */
.tribe-tickets__iac-email-disclaimer {
    display: none !important;
}

/* change 'View Venue Website' link to book rooms button */
body.single-tribe_events a.tribe-venue-url,
body.tribe-events-view a.tribe-venue-url,
body.single-tribe_events .tribe-venue-url a,
body.tribe-events-view .tribe-venue-url a {
    display: inline-block !important;
    position: relative !important; /* for ::after */
    background-color: var(--e-global-color-primary) !important;
    fill: var(--e-global-color-35a525f) !important;
    color: var(--e-global-color-35a525f) !important;
    border-radius: 30px !important;
    border: none !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    transition:
        background-color 0.2s ease,
        color 0.2s ease !important;
    text-decoration: none !important;
    font-size: 0 !important;
    white-space: nowrap !important;
}

body.single-tribe_events .tribe-venue-url:not(a),
body.tribe-events-view .tribe-venue-url:not(a) {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

/* visible label on the anchor */
body.single-tribe_events a.tribe-venue-url::after,
body.tribe-events-view a.tribe-venue-url::after,
body.single-tribe_events .tribe-venue-url a::after,
body.tribe-events-view .tribe-venue-url a::after {
    content: "Book Rooms";
    font-size: 15px !important;
    color: inherit !important;
    pointer-events: none !important;
}

/* hover */
body.single-tribe_events a.tribe-venue-url:not([aria-disabled="true"]):hover,
body.tribe-events-view a.tribe-venue-url:not([aria-disabled="true"]):hover,
body.single-tribe_events .tribe-venue-url a:not([aria-disabled="true"]):hover,
body.tribe-events-view .tribe-venue-url a:not([aria-disabled="true"]):hover {
    background-color: var(--e-global-color-text) !important;
    color: #fff !important;
    cursor: pointer !important;
}

/*  better spacing for ticket descriptions */
.event-tickets .tribe-tickets__tickets-item {
    gap: 0 1rem;
}
