/* ============================================
   CART MODAL - MODERN DESIGN WITH THEME COLORS
   ============================================ */

#cartModal {
    --primary-color: #00b3b0;
    --secondary-color: #caba97;
    --accent-color: #131313;
    --text-dark: #131313;
    --text-light: #7f8c8d;
    --bg-light: #f6f7f6;
    --bg-white: #ffffff;
    --border-color: #e6e2da;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Overlay */
.modal.fade .modal-dialog {
    transform: scale(0.9);
    opacity: 0;
    transition: var(--transition);
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* Modal Content */
.cart-modal-custom .cart-modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-white);
}

.cart-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Modal Header */
.cart-modal-header {
    background: linear-gradient(135deg, #f8fafb 0%, #f6f7f6 100%);
    border: none;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}

.cart-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), #00a39f);
    border-radius: 12px;
    color: white;
    font-size: 20px;
    animation: slideInDown 0.5s ease-out;
}

.cart-modal-header .modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.3px;
}

.cart-btn-close {
    width: 40px;
    height: 40px;
    background: #ff3b30;
    border-radius: 10px;
    transition: var(--transition);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.25);
    position: relative;
    opacity: 1;
}

.cart-btn-close::after {
    content: '✕';
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.cart-btn-close:hover {
    background: #ff453a;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

.cart-btn-close:active {
    transform: scale(0.95) rotate(90deg);
}

/* Modal Body */
.cart-modal-body {
    padding: 35px 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.cart-modal-body::-webkit-scrollbar {
    width: 6px;
}

.cart-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.cart-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.cart-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Product Image Section */
.product-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    background: linear-gradient(135deg, #f8fafb 0%, var(--bg-light) 100%);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    animation: fadeInLeft 0.5s ease-out;
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    transition: var(--transition);
}

.product-image-container:hover .product-img {
    transform: scale(1.05);
}

/* Product Details */
.product-details {
    animation: fadeInRight 0.5s ease-out;
}

.product-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1.3;
    word-break: break-word;
}

.variation-name {
    font-size: 15px;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Price Section */
.price-section {
    background: linear-gradient(135deg, rgba(0, 179, 176, 0.08), rgba(202, 186, 151, 0.08));
    padding: 16px 18px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.price-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 6px;
}

.price-display {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Variants Section */
.variants-section {
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.variants-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
}

.variation-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 3px solid var(--border-color);
    cursor: pointer;
    padding: 0;
    object-fit: cover;
    transition: var(--transition);
    background: var(--bg-light);
}

.variation-thumb:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 179, 176, 0.2);
}

.variation-thumb.active {
    border-color: var(--primary-color);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(0, 179, 176, 0.15), 0 6px 16px rgba(0, 179, 176, 0.25);
    transform: scale(1.08);
}

/* Quantity Section */
.quantity-section {
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.quantity-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
}

.max-qty {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border-radius: 10px;
    padding: 6px;
    width: fit-content;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.quantity-control:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 179, 176, 0.1);
}

.qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--bg-white);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.qty-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.08);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
    padding: 0 8px;
}

.qty-input:focus {
    outline: none;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

/* Notes Section */
.notes-section {
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

.notes-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
}

.notes-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    resize: vertical;
    transition: var(--transition);
    background: var(--bg-light);
}

.notes-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(0, 179, 176, 0.1);
}

.notes-input::placeholder {
    color: var(--text-light);
}

/* Modal Footer */
.cart-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafb 0%, var(--bg-light) 100%);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-continue {
    flex: 1;
    min-width: 150px;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-dark);
}

.btn-continue:hover {
    border-color: var(--text-light);
    background: rgba(0, 0, 0, 0.02);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.btn-add-cart {
    flex: 1;
    min-width: 150px;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--primary-color), #00a39f);
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-add-cart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-add-cart:hover::before {
    width: 400px;
    height: 400px;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 179, 176, 0.3);
    color: white;
}

.btn-add-cart:active {
    transform: translateY(0);
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets - 768px */
@media (max-width: 768px) {
    .cart-modal-custom .modal-dialog {
        margin: 15px;
        max-width: calc(100% - 30px);
    }

    .cart-modal-header {
        padding: 20px 20px;
    }

    .cart-modal-body {
        padding: 25px 20px;
        max-height: 75vh;
    }

    .cart-modal-footer {
        padding: 15px 20px;
        gap: 10px;
    }

    .product-image-container {
        min-height: 250px;
        border-radius: 12px;
    }

    .product-name {
        font-size: 18px;
    }

    .price-display {
        font-size: 24px;
    }

    .btn-continue,
    .btn-add-cart {
        flex: 1;
        min-width: unset;
        padding: 12px 16px;
        font-size: 14px;
    }

    .cart-icon-badge {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .cart-modal-header .modal-title {
        font-size: 18px;
    }
}

/* Large Mobile - 428px */
@media (max-width: 428px) {
    .cart-modal-custom .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .cart-modal-header {
        padding: 18px 16px;
    }

    .cart-modal-body {
        padding: 20px 16px;
        max-height: 80vh;
    }

    .cart-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .product-image-container {
        min-height: 220px;
        margin-bottom: 15px;
    }

    .product-name {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .variation-name {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .price-section {
        padding: 14px 16px;
        margin-bottom: 16px;
    }

    .price-label {
        font-size: 11px;
    }

    .price-display {
        font-size: 22px;
    }

    .variants-label,
    .quantity-label,
    .notes-label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .variation-thumb {
        width: 55px;
        height: 55px;
    }

    .quantity-control {
        gap: 6px;
        padding: 5px;
    }

    .qty-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .qty-input {
        width: 50px;
        font-size: 14px;
    }

    .notes-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-continue,
    .btn-add-cart {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }

    .cart-icon-badge {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .cart-modal-header .modal-title {
        font-size: 16px;
    }

    .max-qty {
        font-size: 11px;
    }
}

/* Small Mobile - 320px */
@media (max-width: 320px) {
    .cart-modal-custom .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }

    .cart-modal-header {
        padding: 16px 12px;
        gap: 8px;
    }

    .cart-modal-body {
        padding: 16px 12px;
    }

    .cart-modal-footer {
        padding: 10px 12px;
    }

    .product-image-container {
        min-height: 200px;
    }

    .product-name {
        font-size: 14px;
    }

    .price-display {
        font-size: 20px;
    }

    .variation-thumb {
        width: 50px;
        height: 50px;
    }

    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .qty-input {
        width: 45px;
    }

    .notes-input {
        font-size: 12px;
    }

    .btn-continue,
    .btn-add-cart {
        padding: 10px 12px;
        font-size: 13px;
    }

    .cart-icon-badge {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .cart-modal-header .modal-title {
        font-size: 14px;
    }
}
