/* Toasts must appear above the floating cart bar and drawer */
#toastContainer {
    z-index: 12000 !important;
}

/* When floating bar is present: back-to-top sits above the bar, square with rounded corners */
.back-to-top-btn {
    bottom: 68px !important; /* Above the ~48px bar + gap */
    border-radius: 12px !important;
    z-index: 11010 !important; /* Above floating bar (11000) */
}

.back-to-top-btn:hover {
    transform: translateY(-2px);
}

/* Hide the floating cart bubble when the floating bar is present (bar is the cart entry point) */
#floatingCartButton {
    display: none !important;
}

/**
 * Floating cart bar - thin bar at bottom, slides up when cart has items (logo red).
 */
.floating-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 11000;
    background: var(--primary-color, #DC143C);
    color: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    min-height: 44px;
    max-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-cart-bar.visible {
    transform: translateY(0);
}

.floating-cart-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.4rem 1rem;
    width: 100%;
    max-width: 600px;
}

.floating-cart-bar-summary {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.floating-cart-bar-summary i {
    font-size: 1rem;
    opacity: 0.95;
}

.floating-cart-bar-sep {
    opacity: 0.8;
    margin: 0 0.2rem;
}

.floating-cart-bar-btn {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.floating-cart-bar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
}

.floating-cart-bar-btn-checkout {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color, #DC143C);
    border-color: #fff;
}

.floating-cart-bar-btn-checkout:hover {
    background: #fff;
    color: var(--primary-color, #DC143C);
}

/* Beta: bar with count left, arrow center, total right; no buttons */
.floating-cart-bar-beta .floating-cart-bar-inner {
    justify-content: space-between;
    max-width: none;
    padding-left: 1rem;
    padding-right: 1rem;
}
.floating-cart-bar-left {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.floating-cart-bar-left i {
    opacity: 0.95;
}
.floating-cart-bar-arrow {
    background: none;
    border: none;
    color: #fff;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
    animation: floating-arrow-bounce 2s ease-in-out infinite;
}
.floating-cart-bar-arrow:hover {
    color: rgba(255, 255, 255, 0.95);
}
.floating-cart-bar-arrow.open {
    animation: floating-arrow-bounce-open 2s ease-in-out infinite;
}
@keyframes floating-arrow-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes floating-arrow-bounce-open {
    0%, 100% { transform: rotate(180deg) translateY(0); }
    50% { transform: rotate(180deg) translateY(3px); }
}
.floating-cart-bar-arrow i {
    font-size: 1.1rem;
}
.floating-cart-bar-right {
    font-size: 1rem;
    font-weight: 700;
}

/* Beta: slide-up cart drawer (sits above the floating bar); when closed, fully off bottom of page; dark theme */
/* Prevent page scroll when floating cart drawer is open */
html.floating-cart-drawer-open,
body.floating-cart-drawer-open {
    overflow: hidden;
    touch-action: none;
}

/* Prevent page scroll when express checkout modal is open */
html.express-checkout-modal-open,
body.express-checkout-modal-open {
    overflow: hidden;
    touch-action: none;
}

.floating-cart-drawer {
    position: fixed;
    bottom: 48px;
    left: 0;
    right: 0;
    z-index: 10990;
    max-height: calc(70vh - 48px);
    background: #1a1a1a;
    color: #e8e8e8;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    border-radius: 16px 16px 0 0;
    transform: translateY(100vh);
    transition: transform 0.35s ease-out;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.floating-cart-drawer.open {
    transform: translateY(0);
}
.floating-cart-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10985;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.floating-cart-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.floating-cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.floating-cart-drawer-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}
.floating-cart-drawer-actions .floating-cart-bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.floating-cart-drawer-btn-cart,
.floating-cart-drawer-btn-checkout,
.floating-cart-drawer-btn-express {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}
.floating-cart-drawer-btn-cart {
    background: #3a3a3a;
    color: #fff;
    border-color: #555;
}
.floating-cart-drawer-btn-cart:hover {
    background: #444;
    color: #fff;
    border-color: #666;
}
.floating-cart-drawer-btn-checkout {
    background: var(--primary-color, #DC143C);
    color: #fff;
    border-color: var(--primary-color, #DC143C);
}
.floating-cart-drawer-btn-checkout:hover {
    background: #c41238;
    color: #fff;
    filter: brightness(1.05);
}
.floating-cart-drawer-btn-express {
    background: #2d2d2d;
    color: #fff;
    border-color: #444;
}
.floating-cart-drawer-btn-express:hover:not(.disabled) {
    background: #3a3a3a;
    border-color: var(--primary-color, #DC143C);
    color: #fff;
}
.floating-cart-drawer-btn-express.disabled {
    background: #2a2a2a;
    color: #666;
    border-color: #3a3a3a;
    cursor: not-allowed;
    pointer-events: none;
}
.floating-cart-drawer-close {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    border-radius: 8px;
}
.floating-cart-drawer-close:hover {
    background: #333;
    color: #fff;
}
.floating-cart-drawer-body {
    flex: 1;
    min-height: 0;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.floating-cart-drawer-body .text-muted {
    color: #888 !important;
}
.floating-cart-drawer-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}
.floating-cart-drawer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #333;
    font-size: 0.9rem;
    color: #e8e8e8;
}
.floating-cart-drawer-item:last-child {
    border-bottom: none;
}
.floating-cart-drawer-item-name {
    flex: 1;
    margin-right: 0.5rem;
}
.floating-cart-drawer-item-qty {
    color: #999;
    margin-right: 0.5rem;
}
.floating-cart-drawer-item-price {
    font-weight: 600;
    color: #fff;
    text-align: right;
    margin-right: 0.25rem;
}
.floating-cart-drawer-item-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
}
.floating-cart-drawer-item-remove:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.floating-cart-drawer-item-remove i {
    font-size: 0.7rem;
}

/* Entire line (title, pack, price) in yellow only for items on special that meet requirements */
.floating-cart-drawer-item-special .floating-cart-drawer-item-name,
.floating-cart-drawer-item-special .floating-cart-drawer-item-qty,
.floating-cart-drawer-item-special .floating-cart-drawer-item-price {
    color: #ffc107;
    font-weight: 600;
}

.floating-cart-drawer-totals {
    flex-shrink: 0;
    padding: 0.75rem 0;
    border-top: 1px solid #333;
}
.floating-cart-drawer-savings {
    color: #5dd39e;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}
.floating-cart-drawer-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    color: #e8e8e8;
}
.floating-cart-drawer-total-row {
    font-size: 1.1rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    color: #fff;
}
.floating-cart-drawer-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}
.floating-cart-drawer-actions .floating-cart-bar-btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* Express checkout modal (dark theme) */
.express-checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.express-checkout-modal.open {
    opacity: 1;
    pointer-events: auto;
}
.express-checkout-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}
.express-checkout-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: auto;
}
.express-checkout-modal-content {
    background: #1a1a1d;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.express-checkout-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.express-checkout-modal-back {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 8px;
    color: #b0b0b0;
    font-size: 0.9rem;
    cursor: pointer;
}
.express-checkout-modal-back:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.express-checkout-modal-title {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f0f0;
    text-align: center;
}
.express-checkout-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f0f0f0;
}
.express-checkout-modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b0b0b0;
    border-radius: 8px;
}
.express-checkout-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.express-checkout-modal-body {
    padding: 1.25rem;
}
.express-checkout-modal-hint {
    font-size: 0.85rem;
    color: #a0a0a8;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}
.express-checkout-field {
    margin-bottom: 1rem;
}
.express-checkout-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #d8d8dc;
}
.express-checkout-field input,
.express-checkout-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 1rem;
    background: #252529;
    color: #f0f0f0;
}
.express-checkout-field input::placeholder {
    color: #707078;
}
.express-checkout-field input:focus,
.express-checkout-field select:focus {
    outline: none;
    border-color: var(--primary-color, #DC143C);
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.2);
}
.express-checkout-field select option {
    background: #252529;
    color: #f0f0f0;
}
.express-checkout-fee-row,
.express-checkout-amount-row,
.express-checkout-vehicle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.express-checkout-amount-label {
    font-size: 0.85rem;
    color: #a0a0a8;
}
.express-checkout-amount-value {
    font-weight: 600;
    font-size: 1rem;
    color: #e8e8e8;
}
.express-checkout-vehicle-label {
    font-size: 0.85rem;
    color: #a0a0a8;
}
#express-checkout-vehicle-summary {
    flex: 1;
    font-size: 0.9rem;
    color: #e8e8e8;
}
.express-checkout-vehicle-edit-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #a0a0a8;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.express-checkout-vehicle-edit-btn:hover {
    color: #e8e8e8;
    border-color: rgba(255,255,255,0.35);
}
.express-vehicle-modal {
    z-index: 12100;
}
body.express-vehicle-modal-open {
    overflow: hidden;
}
.express-vehicle-modal .express-checkout-modal-dialog { max-width: 400px; }
.express-vehicle-modal .form-control.express-vehicle-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    font-size: 1rem;
    background: #252529;
    color: #f0f0f0;
}
.express-vehicle-modal .form-control.express-vehicle-input:focus {
    outline: none;
    border-color: var(--primary-color, #DC143C);
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.2);
}
.express-vehicle-modal .form-label {
    font-size: 0.85rem;
    color: #a0a0a8;
    margin-bottom: 0.25rem;
    display: block;
}
#express-checkout-fee-label {
    font-size: 0.85rem;
    color: #a0a0a8;
}
#express-checkout-fee {
    font-weight: 600;
    color: #e8e8e8;
}
#express-checkout-fee .text-success {
    color: #5cb85c !important;
}
#express-checkout-fee .text-muted {
    color: #888 !important;
}
.express-checkout-fee-waived-note {
    width: 100%;
    font-size: 0.8rem;
    color: #a0a0a8;
    margin-top: 0.25rem;
    margin-left: 0;
}
.express-checkout-card-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 1rem;
    background: #252529;
    color: #f0f0f0;
}
.express-checkout-card-select:focus {
    outline: none;
    border-color: var(--primary-color, #DC143C);
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.2);
}
.express-checkout-card-select option {
    background: #252529;
    color: #f0f0f0;
}
.express-checkout-card {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: #252529;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #e0e0e4;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.express-checkout-card .text-muted {
    color: #909098 !important;
}
.express-checkout-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.express-checkout-modal-actions a,
.express-checkout-modal-actions button {
    display: block;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(220, 20, 60, 0.5);
    cursor: pointer;
    font-size: 0.95rem;
    background: transparent;
    color: var(--primary-color, #DC143C);
}
.express-checkout-modal-actions a:hover,
.express-checkout-modal-actions button:hover {
    background: rgba(220, 20, 60, 0.1);
}
.express-checkout-modal-actions .floating-cart-bar-btn-checkout {
    background: var(--primary-color, #DC143C);
    color: #fff;
    border-color: var(--primary-color, #DC143C);
}
.express-checkout-modal-actions .floating-cart-bar-btn-checkout:hover {
    filter: brightness(1.1);
}
