/**
 * Cart Styling
 */

/* Main Cart Container */
.tf-mini-cart {
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

/* Cart Header */
.tf-mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 20px;
}

.tf-mini-cart-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.tf-mini-cart-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #666;
    transition: color 0.2s;
}

.tf-mini-cart-close:hover {
    color: #000;
}

/* Cart Items */
.tf-mini-cart-items {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.tf-mini-cart-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.tf-mini-cart-item:last-child {
    border-bottom: none;
}

.tf-mini-cart-image {
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.tf-mini-cart-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.tf-mini-cart-info {
    flex-grow: 1;
    min-width: 0;
}

.tf-mini-cart-item-title {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 0.95rem;
    color: #333;
    text-decoration: none;
}

.tf-mini-cart-item-title:hover {
    color: #0066cc;
}

.tf-mini-cart-item-variant {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.tf-mini-cart-item-price {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.tf-btn-remove {
    color: #dc3545;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

.tf-btn-remove:hover {
    color: #b02a37;
    text-decoration: underline;
}

/* Empty Cart */
.tf-mini-cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.tf-mini-cart-empty i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.tf-mini-cart-empty h5 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.tf-mini-cart-empty p {
    color: #666;
    margin-bottom: 20px;
}

.tf-btn-outline {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #333;
    background: none;
    color: #333;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.tf-btn-outline:hover {
    background: #333;
    color: #fff;
}

/* Shipping Threshold */
.tf-shipping-threshold {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.tf-shipping-text {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 10px;
}

.tf-shipping-progress {
    height: 8px;
    background-color: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.tf-shipping-progress-bar {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Cart Tools */
.tf-mini-cart-tool {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 20px 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 0;
}

.tf-mini-cart-tool-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.tf-mini-cart-tool-btn:hover {
    color: #0066cc;
}

.tf-mini-cart-tool-btn svg {
    margin-right: 5px;
    width: 18px;
    height: 18px;
}

/* Tool openable sections */
.tf-mini-cart-tool-openable {
    display: none;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 1rem;
    background-color: white;
}

.tf-mini-cart-tool-openable.active {
    display: block;
}

.tf-mini-cart-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tf-mini-cart-tool-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
}

.tf-mini-cart-tool-title svg {
    margin-right: 8px;
}

.tf-mini-cart-tool-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    float: right;
}

.tf-mini-cart-tool-close:hover {
    color: #333;
}

/* Forms in tools */
.tf-mini-cart-tool-form {
    margin-top: 15px;
}

.tf-form-group {
    margin-bottom: 15px;
}

.tf-form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #555;
}

.tf-form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.tf-form-control:focus {
    border-color: #0066cc;
    outline: none;
}

.tf-form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #fff;
}

.tf-btn-primary {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tf-btn-primary:hover {
    background-color: #0066cc;
}

/* Cart Totals */
.tf-mini-cart-totals {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.tf-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.tf-totals-row:last-child {
    border-bottom: none;
}

.tf-totals-label {
    color: #666;
}

.tf-totals-value {
    font-weight: 500;
    color: #333;
}

.tf-totals-total {
    font-weight: bold;
    font-size: 1.1rem;
    padding-top: 1rem;
    border-top: 2px solid #dee2e6;
    margin-top: 0.5rem;
}

.tf-totals-total-value {
    font-size: 1.2rem;
    color: #28a745;
}

/* Checkout Button */
.tf-checkout-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    margin-top: 1rem;
    display: block;
    transition: background-color 0.2s;
}

.tf-checkout-btn:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

/* Notification */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-notification.success {
    background-color: #4CAF50;
}

.cart-notification.error {
    background-color: #ff4136;
}

.cart-notification.info {
    background-color: #0066cc;
}

/* Responsive */
@media (max-width: 767px) {
    .tf-mini-cart-tool {
        flex-direction: column;
        gap: 10px;
    }
    
    .tf-mini-cart-item {
        flex-direction: column;
    }
    
    .tf-mini-cart-item-img {
        margin-bottom: 10px;
    }
    
    .tf-btn-remove {
        top: -5px;
    }
}

/* Variant Information Styling */
.variant-info {
    margin-top: 0.5rem;
}

.variant-option {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    color: #6c757d;
    display: inline-block;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Quantity Controls */
.quantity-controls {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
}

.quantity-controls .btn {
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    border-radius: 0;
    color: #6c757d;
    transition: all 0.2s;
}

.quantity-controls .btn:hover {
    background-color: #f8f9fa;
    color: #333;
}

.quantity-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-controls .quantity-display {
    min-width: 2rem;
    text-align: center;
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

/* Loading States */
.btn.loading {
    position: relative;
    overflow: hidden;
}

.btn.loading .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tf-mini-cart-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tf-mini-cart-image {
        align-self: center;
    }
    
    .tf-mini-cart-info .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start !important;
    }
    
    .quantity-controls {
        align-self: flex-start;
    }
}

/* Add to Cart Button States */
.add-to-cart-btn.loading,
.btn-add-to-cart.loading,
[data-action="add-to-cart"].loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Progress Bar for Shipping */
.tf-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.tf-progress-bar .value {
    height: 100%;
    background-color: #28a745;
    transition: width 0.3s ease;
}

/* Shipping Threshold */
.tf-mini-cart-threshold {
    padding: 1rem;
    background-color: #e8f5e8;
    border-radius: 4px;
    margin: 1rem 0;
    text-align: center;
    border: 1px solid #c3e6c3;
}

.tf-mini-cart-threshold.reached {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
} 