/* ========================================
   GLOBAL CART STYLES
   Стили для глобальной корзины на всех страницах
   ======================================== */

/* FAB Button */
.cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-red, #ff003c), #ff6b9d);
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(255, 0, 60, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10100;
}

.cart-fab:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 0, 60, 0.6);
}

.cart-fab:active {
    transform: translateY(-2px) scale(0.98);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: var(--accent-red, #ff003c);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid var(--accent-red, #ff003c);
    animation: cartPulse 0.4s ease;
}

@keyframes cartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10300;
}

.cart-sidebar.active {
    transform: translateX(0);
}

/* Cart Header */
.cart-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cart-header-left {
    flex: 1;
}

.cart-title {
    font-size: 22px;
    letter-spacing: 1px;
    margin-bottom: 4px;
    color: #fff;
}

.cart-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.cart-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cart-close:hover {
    background: rgba(255, 0, 60, 0.15);
    border-color: rgba(255, 0, 60, 0.3);
    color: var(--accent-red, #ff003c);
}

/* Cart Items */
.cart-items-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Empty State */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Cart Item */
.cart-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.cart-item:hover {
    border-color: rgba(255, 0, 60, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.cart-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-code {
    font-size: 16px;
    letter-spacing: 1px;
    color: #fff;
}

.cart-item-remove {
    width: 28px;
    height: 28px;
    background: rgba(255, 0, 60, 0.1);
    border: 1px solid rgba(255, 0, 60, 0.2);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-red, #ff003c);
    transition: all 0.2s ease;
}

.cart-item-remove:hover {
    background: rgba(255, 0, 60, 0.2);
    transform: scale(1.05);
}

.cart-item-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-divider {
    opacity: 0.3;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.minutes-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.minutes-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.minutes-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.minutes-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    transition: all 0.2s ease;
}

.minutes-btn:hover {
    background: rgba(255, 0, 60, 0.15);
    border-color: rgba(255, 0, 60, 0.3);
    color: var(--accent-red, #ff003c);
}

.minutes-input {
    width: 50px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.minutes-input:focus {
    outline: none;
    border-color: rgba(255, 0, 60, 0.4);
}

.item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.price-calc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.price-total {
    font-size: 18px;
    color: var(--accent-red, #ff003c);
    letter-spacing: -0.5px;
}

/* Cart Footer */
.cart-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-footer-actions {
    display: flex;
    gap: 10px;
}

.cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 0, 60, 0.05);
    border: 1px solid rgba(255, 0, 60, 0.2);
    border-radius: 8px;
}

.total-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1.5px;
}

.total-amount {
    font-size: 26px;
    color: var(--accent-red, #ff003c);
    letter-spacing: -1px;
}

.btn-checkout,
.btn-clear-cart,
.btn-close-cart {
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--accent-red, #ff003c), #ff6b9d);
    border: none;
    color: #fff;
    flex: 1;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 0, 60, 0.4);
}

.btn-checkout:active {
    transform: translateY(0);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-clear-cart,
.btn-close-cart {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
}

.btn-clear-cart:hover,
.btn-close-cart:hover {
    background: rgba(255, 0, 60, 0.1);
    border-color: rgba(255, 0, 60, 0.3);
    color: var(--accent-red, #ff003c);
}

/* Scrollbar */
.cart-items-wrapper::-webkit-scrollbar {
    width: 6px;
}

.cart-items-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.cart-items-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 60, 0.3);
    border-radius: 3px;
}

.cart-items-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 60, 0.5);
}

/* ========================================
   ORDER MODAL
   ======================================== */
.order-modal {
    position: fixed;
    inset: 0;
    z-index: 10400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.order-modal.active {
    display: flex;
}

.order-modal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.order-modal .modal-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-modal .modal-content {
    background: rgba(0, 0, 0, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* Modal Header */
.order-modal .modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.order-modal .modal-title {
    font-size: 22px;
    letter-spacing: 1px;
    color: #fff;
}

.order-modal .modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.order-modal .modal-close:hover {
    background: rgba(255, 0, 60, 0.15);
    border-color: rgba(255, 0, 60, 0.3);
    color: var(--accent-red, #ff003c);
}

/* Modal Body */
.order-modal .modal-body {
    padding: 24px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Summary */
.order-summary-compact {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.summary-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    font-size: 12px;
}

.summary-item-info {
    flex: 1;
    color: rgba(255, 255, 255, 0.7);
}

.summary-item-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.summary-item-details {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.summary-item-price {
    font-weight: 700;
    color: var(--accent-red, #ff003c);
}

.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 0, 60, 0.05);
    border: 1px solid rgba(255, 0, 60, 0.2);
    border-radius: 8px;
}

.total-value {
    font-size: 24px;
    color: var(--accent-red, #ff003c);
    letter-spacing: -1px;
}

/* Form */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.field-input,
.field-textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.field-input:focus,
.field-textarea:focus {
    outline: none;
    border-color: rgba(255, 0, 60, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.field-textarea {
    resize: vertical;
    font-family: inherit;
}

/* Form Actions */
.form-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
}

.btn-cancel,
.btn-submit {
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.btn-submit {
    background: linear-gradient(135deg, var(--accent-red, #ff003c), #ff6b9d);
    border: none;
    color: #fff;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 0, 60, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success */
.order-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(0, 255, 100, 0.1);
    border: 2px solid rgba(0, 255, 100, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff64;
    animation: successPulse 2s infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.success-title {
    font-size: 28px;
    margin-bottom: 12px;
    color: #fff;
}

.success-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.success-order-number {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 32px;
}

.success-order-number span {
    color: var(--accent-red, #ff003c);
    font-weight: 700;
}

.btn-success-close {
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--accent-red, #ff003c), #ff6b9d);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 0, 60, 0.4);
}

/* Scrollbar */
.order-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.order-modal .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.order-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 60, 0.3);
    border-radius: 3px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .cart-fab {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .cart-sidebar {
        max-width: 100%;
    }

    .order-modal {
        padding: 0;
    }

    .order-modal .modal-container {
        max-width: 100%;
        max-height: 100vh;
    }

    .order-modal .modal-content {
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .order-modal .modal-body {
        flex: 1;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        grid-template-columns: 1fr;
    }
}
