/*
 * Cart Timer - Header countdown + cancel modal styles
 */

/* ---- Cart block: anchor for floating timer ---- */
.header-top__block--cart {
    position: relative;
}

/* ---- Floating countdown badge ---- */
.cart-timer-header-countdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: #151F35;
    color: #fff;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: background 0.3s ease;
}

/* Arrow pointing up to cart icon */
.cart-timer-header-countdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #151F35;
    transition: border-color 0.3s ease;
}

.cart-timer-time {
    display: flex;
    align-items: center;
    gap: 1px;
}

.cart-timer-sep {
    animation: cart-timer-blink 1s infinite;
    color: inherit;
}

@keyframes cart-timer-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.cart-timer-cancel {
    font-size: 14px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    margin-left: 2px;
    transition: color 0.2s ease;
}

.cart-timer-cancel:hover {
    color: #fff;
}

/* ---- Warning state ---- */
.cart-timer--warning {
    background: #e67e22;
    color: #fff;
}

.cart-timer--warning::before {
    border-bottom-color: #e67e22;
}

/* ---- Critical state ---- */
.cart-timer--critical {
    background: #e74c3c;
    color: #fff;
    animation: cart-timer-pulse 1s infinite;
}

.cart-timer--critical::before {
    border-bottom-color: #e74c3c;
}

@keyframes cart-timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .cart-timer-header-countdown {
        font-size: 11px;
        padding: 4px 8px;
        gap: 4px;
    }
}

/* ---- Overlay ---- */
.cart-timer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    backdrop-filter: blur(2px);
}

.cart-timer-overlay.show {
    display: block;
}

/* ---- Cancel modal ---- */
.cart-timer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    max-width: 400px;
    width: calc(100% - 40px);
    display: none;
}

.cart-timer-modal.show {
    display: block;
}

.timer-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.timer-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.timer-modal-close:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.timer-modal-body {
    padding: 16px 24px 24px;
    color: #5a6c7d;
    line-height: 1.5;
}

.timer-modal-warning {
    color: #e67e22;
    font-weight: 500;
    margin-top: 12px;
    margin-bottom: 0;
}

.timer-modal-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.timer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

.timer-btn-secondary {
    background: #ecf0f1;
    color: #5a6c7d;
    border: 1px solid #d5dbdb;
}

.timer-btn-secondary:hover {
    background: #d5dbdb;
}

.timer-btn-danger {
    background: #fff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.timer-btn-danger:hover {
    background: #e74c3c;
    color: #fff;
}

/* ---- Notifications ---- */
.cart-timer-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cart-timer-notification .notification-content p {
    margin: 4px 0 0;
    opacity: 0.9;
}

.cart-timer-notification .notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
}

.cart-timer-notification .notification-close:hover {
    opacity: 1;
}

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
    .cart-timer-sep,
    .cart-timer--critical {
        animation: none;
    }
}
