/* =========================================
   CART DRAWER & ICON
   ========================================= */

/* Floating Cart Icon */
.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, #FDC667, #E4A635);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(253, 198, 103, 0.4);
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media screen and (min-width: 1500px) {
    .floating-cart {
        right: max(30px, calc(50% - 720px - 120px)); /* Moved 150px total to the right */
    }
}

.floating-cart:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(253, 198, 103, 0.6);
}

.floating-cart svg {
    width: 36px;
    height: 36px;
    fill: #050409;
}

.floating-contact {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #050409;
    border: 2px solid #FDC667;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(5, 4, 9, 0.4);
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media screen and (min-width: 1500px) {
    .floating-contact {
        right: max(30px, calc(50% - 720px - 120px));
    }
}

.floating-contact:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(253, 198, 103, 0.4);
}

.floating-contact svg {
    width: 30px;
    height: 30px;
    stroke: #FDC667;
}

.floating-contact svg path {
    stroke: #FDC667 !important;
}

.floating-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF4757;
    color: #FFF;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #050409;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-cart-badge.pop {
    transform: scale(1.3);
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Drawer */
.cart-drawer {
    position: absolute;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100%;
    height: 100%;
    background: #050409;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    color: #F8F5EE;
    border-left: 1px solid rgba(253, 198, 103, 0.2);
}

.cart-overlay.active .cart-drawer {
    right: 0;
}

/* Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cart-title {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--accent-gold);
    margin: 0;
}

.cart-close {
    background: transparent;
    border: none;
    color: #FFF;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
}

.cart-close:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
}

/* Body */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.cart-empty-message {
    text-align: center;
    color: #999;
    font-family: var(--font-main);
    font-size: 16px;
    margin-top: 50px;
}

/* Items */
.cart-item {
    display: flex;
    gap: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    position: relative;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cart-item.removing {
    transform: translateX(100%);
    opacity: 0;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-family: var(--font-main);
    font-size: 15px;
    color: #F8F5EE;
    font-weight: 500;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.cart-item-volume {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 16px;
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 12px;
}

/* Quantity Control */
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 4px 8px;
    width: fit-content;
}

.cart-qty-btn {
    background: transparent;
    border: none;
    color: #F8F5EE;
    font-size: 16px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.cart-qty-btn:hover {
    background: rgba(255,255,255,0.1);
}

.cart-qty-val {
    font-size: 14px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

.cart-item-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.cart-item-remove:hover {
    color: #FF4757;
}

/* Footer */
.cart-footer {
    padding: 30px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.cart-total-label {
    font-size: 18px;
    color: #CCC;
}

.cart-total-price {
    font-family: var(--font-heading);
    font-size: 26px;
    color: var(--accent-gold);
    font-weight: 500;
}

.cart-checkout-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #FDC667, #E4A635);
    color: #050409;
    border: none;
    border-radius: 100px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 198, 103, 0.3);
}

.cart-checkout-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Checkout Form */
.checkout-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.checkout-form.active {
    display: flex;
}

.cart-items-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-items-view.hidden {
    display: none;
}

.checkout-back {
    background: transparent;
    border: none;
    color: var(--accent-gold);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 0;
}

.checkout-back:hover {
    text-decoration: underline;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #CCC;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #FFF;
    font-family: var(--font-main);
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .cart-drawer {
        width: 100%;
        right: -100%;
    }
}

/* Autocomplete List for Nova Poshta */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1C1A29;
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.autocomplete-list.hidden {
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    color: #FFF;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(253, 198, 103, 0.2);
    color: var(--accent-gold);
}
