/**
 * MAVI Shopping Cart Styles
 */

/* Cart Icon in Header */
.cart-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 15px;
    cursor: pointer;
    float: left;
}

.cart-icon-wrapper a {
    color: #fff;
    font-size: 22px;
    display: block;
    padding: 0 15px;
    line-height: 96px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cart-icon-wrapper a:hover {
    color: #3a9ac8;
    text-decoration: none;
}

#header.fixed .cart-icon-wrapper a {
    line-height: 79px;
}

.navigation-row .cart-icon-wrapper {
    float: left;
    margin-right: 10px;
}

#cart-badge {
    position: absolute;
    top: 24px;
    right: -2px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

#header.fixed #cart-badge {
    top: 18px;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-modal.open {
    visibility: visible;
    opacity: 1;
}

.cart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.cart-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    width: 95%;
    max-width: 700px;
    max-height: 95vh;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.cart-modal.open .cart-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.cart-modal-header {
    background: linear-gradient(135deg, #2b7396 0%, #3a9ac8 100%);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-modal-header h3 i {
    font-size: 20px;
}

.cart-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cart-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    min-height: 100px;
}

.cart-modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
}

/* Cart Empty State */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.cart-empty i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.cart-empty p {
    font-size: 18px;
    margin: 0;
}

/* Cart Items */
.cart-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    gap: 12px;
}

.cart-item:last-child {
    margin-bottom: 0;
}

.cart-item-image {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-details h5 {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 600;
    color: #242424;
}

.cart-item-category {
    display: block;
    font-size: 12px;
    color: #3a9ac8;
    font-weight: 500;
    margin-bottom: 2px;
}

.cart-item-price {
    display: block;
    font-size: 14px;
    color: #27ae60;
    font-weight: 600;
    margin-bottom: 2px;
}

.cart-item-specs,
.cart-item-sku {
    display: block;
    font-size: 11px;
    color: #888;
}

.cart-item-total {
    font-size: 15px;
    font-weight: 700;
    color: #242424;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.qty-btn:hover {
    background: #3a9ac8;
    border-color: #3a9ac8;
    color: #fff;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.cart-item-remove:hover {
    opacity: 1;
}

/* Cart Footer Totals */
.cart-totals-summary {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.cart-subtotal,
.cart-shipping {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    color: #666;
}

.cart-modal-footer .cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid #e5e5e5;
    font-size: 18px;
}

.cart-modal-footer .cart-total span:first-child {
    color: #333;
    font-weight: 600;
}

.cart-total-price {
    font-size: 22px;
    font-weight: 700;
    color: #27ae60;
}

/* Cart Footer Buttons */
.cart-buttons {
    display: flex;
    gap: 12px;
}

.cart-buttons .btn {
    flex: 1;
    text-align: center;
    border-radius: 5px;
}

.cart-buttons .btn-grey {
    background: #6c757d;
    border-radius: 5px;
}

.cart-buttons .btn-grey:hover {
    background: #5a6268;
}

.btn-checkout {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 5px;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #219a52 0%, #27ae60 100%);
}

/* Checkout Form */
.checkout-form {
    padding: 0;
}

.checkout-form .form-group {
    margin-bottom: 12px;
}

.checkout-form label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.checkout-form label .required {
    color: #e74c3c;
}

.checkout-form .form-control {
    border-radius: 6px;
    height: 40px;
    border: 1px solid #ddd;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.checkout-form .form-control:focus {
    border-color: #3a9ac8;
    box-shadow: 0 0 0 2px rgba(58, 154, 200, 0.15);
}

.checkout-form textarea.form-control {
    height: 50px;
    resize: none;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.phone-input-wrapper {
    position: relative;
}

.phone-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 500;
    font-size: 14px;
    pointer-events: none;
}

.phone-input-wrapper .form-control {
    padding-left: 50px;
}

/* Payment Method */
.payment-method {
    background: #f0f9ff;
    border: 2px solid #3a9ac8;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-method input[type="radio"] {
    display: none;
}

.payment-method label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    width: 100%;
}

.payment-check {
    width: 24px;
    height: 24px;
    border: 2px solid #3a9ac8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3a9ac8;
    flex-shrink: 0;
}

.payment-check i {
    color: #fff;
    font-size: 12px;
}

.payment-info {
    flex: 1;
}

.payment-info span {
    display: block;
}

.payment-info .payment-name {
    font-weight: 600;
    color: #242424;
    font-size: 16px;
}

.payment-info .payment-desc {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

.payment-icon {
    font-size: 28px;
    color: #3a9ac8;
}

/* Order Summary */
#order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 12px;
}

#order-summary h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}

.order-items {
    max-height: 120px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-info {
    flex: 1;
    min-width: 0;
}

.order-item-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #e5e5e5;
}

.order-item-info {
    flex: 1;
}

.order-item-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.order-item-qty,
.order-item-sku {
    display: block;
    font-size: 11px;
    color: #888;
}

.order-item-price {
    font-weight: 700;
    font-size: 13px;
    color: #27ae60;
    margin-left: auto;
    flex-shrink: 0;
}

.order-totals {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e5e5;
}

.order-subtotal,
.order-shipping {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 12px;
    color: #666;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    margin-top: 5px;
    border-top: 2px solid #3a9ac8;
    font-size: 14px;
}

.order-total span {
    color: #333;
    font-weight: 600;
}

.order-total strong {
    font-size: 16px;
    color: #27ae60;
}

/* Back Button */
.btn-back {
    background: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    background: #5a6268;
}

/* Submit Order Button */
#submit-order-btn {
    height: 44px;
    font-size: 15px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

#submit-order-btn:hover {
    background: linear-gradient(135deg, #219a52 0%, #27ae60 100%);
}

#submit-order-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Success View */
.success-view {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-icon i {
    font-size: 50px;
    color: #fff;
}

.success-view h3 {
    color: #27ae60;
    margin-bottom: 15px;
}

.success-view p {
    color: #666;
    font-size: 15px;
    margin-bottom: 10px;
}

.order-number-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px 20px;
    display: inline-block;
    margin: 20px 0;
}

.order-number-box span {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 5px;
}

.order-number-box strong {
    font-size: 24px;
    color: #3a9ac8;
    letter-spacing: 2px;
}

/* Order Warning */
.order-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 13px;
    text-align: left;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 15px;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.cart-notification.show {
    transform: translateX(-50%) translateY(0);
}

.cart-notification i {
    color: #2ecc71;
    font-size: 18px;
}

/* Product Price Display */
.product-price {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 15px;
    text-align: center;
}

.product-price::before {
    content: 'Цена: ';
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

/* Add to Cart Button Style */
.btn-add-to-cart {
    background: linear-gradient(135deg, #2b7396 0%, #3a9ac8 100%);
    position: relative;
    overflow: hidden;
}

.btn-add-to-cart:hover {
    background: linear-gradient(135deg, #235d7a 0%, #2b7396 100%);
}

.btn-add-to-cart i {
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-modal-content {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
        display: flex;
        flex-direction: column;
    }

    .cart-modal.open .cart-modal-content {
        transform: none;
    }

    .cart-modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 15px;
        min-height: 0;
    }

    .cart-modal-footer {
        flex-shrink: 0;
        padding: 15px;
        background: #f8f9fa;
        border-top: 1px solid #e5e5e5;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-details {
        width: calc(100% - 150px);
    }

    .cart-item-quantity {
        margin-left: 75px;
        margin-top: 10px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Бутони на мобилен - пълна ширина и по-големи */
    .cart-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .cart-buttons .btn {
        width: 100%;
        min-height: 50px;
        font-size: 16px;
        border-radius: 5px;
    }

    .cart-buttons .btn-grey {
        order: 2;
    }

    /* Cart icon на мобилен - вляво от menu бутона */
    .cart-icon-wrapper {
        position: absolute;
        right: 70px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        z-index: 100;
    }

    .cart-icon-wrapper a {
        line-height: 40px;
        padding: 0 10px;
        font-size: 20px;
    }

    #cart-badge {
        top: -5px;
        right: 0;
    }

    .checkout-layout {
        flex-direction: column;
    }
    
    .checkout-layout #order-summary {
        width: 100%;
    }
    
    .checkout-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .checkout-actions .btn {
        width: 100%;
        min-height: 50px;
        font-size: 16px;
    }
    
    .checkout-actions .btn-back {
        order: 2;
    }

    /* Checkout view на мобилен */
    #checkout-view {
        flex: 1;
        min-height: 0;
        display: none;
    }

    #checkout-view .cart-modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }

    /* Success view на мобилен */
    #success-view {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .cart-modal-header {
        padding: 12px 15px;
    }

    .cart-modal-header h3 {
        font-size: 16px;
    }

    .cart-modal-body {
        padding: 12px;
    }

    .cart-modal-footer {
        padding: 12px 15px;
    }

    .cart-item-details h5 {
        font-size: 13px;
    }

    .checkout-form .form-control {
        font-size: 16px; /* Предотвратява zoom на iOS */
    }

    .checkout-form label {
        font-size: 12px;
    }
}

/* View States */
#cart-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#checkout-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#success-view {
    display: none;
    flex: 1;
    overflow-y: auto;
}

/* Checkout Two-Column Layout */
.checkout-layout {
    display: flex;
    gap: 20px;
    flex-direction: column;
}

@media (min-width: 600px) {
    .checkout-layout {
        flex-direction: row;
    }
    
    .checkout-layout #order-summary {
        width: 220px;
        flex-shrink: 0;
        margin-bottom: 0;
    }
    
    .checkout-layout .checkout-form {
        flex: 1;
    }
}

/* Compact Payment Method */
.payment-method-compact {
    background: #f0f9ff;
    border: 1px solid #3a9ac8;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-method-compact i {
    color: #3a9ac8;
}

/* Checkout Actions */
.checkout-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.checkout-actions .btn {
    flex: 1;
    height: 44px;
}

.checkout-actions .btn-back {
    flex: 0 0 auto;
    padding: 0 20px;
}

.checkout-actions .btn-checkout {
    flex: 1;
}

