/* Shopee-style Mobile Sticky Cart - Optimized Version */
:root {
    --shopee-primary: #ee4d2d;
    --shopee-secondary: #ff6533;
    --shopee-gradient-cart: linear-gradient(0deg, #f05d40, #ff6533);
    --shopee-gradient-buy: linear-gradient(0deg, #ee4d2d, #ff6533);
    --shopee-gradient-hover: linear-gradient(0deg, #d84315, #ee4d2d);
}

/* Main Sticky Cart */
.shopee-sticky-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    display: block;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Cart Content Layout - Chỉ có 2 nút */
.shopee-sticky-cart-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    justify-content: center;
}

/* Action Buttons */
.shopee-sticky-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
}

.shopee-sticky-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shopee-sticky-cart-btn {
    background: var(--shopee-gradient-cart);
    color: #fff;
    border: 1px solid var(--shopee-primary);
}

.shopee-sticky-cart-btn:hover {
    background: var(--shopee-gradient-hover);
    transform: translateY(-1px);
}

.shopee-sticky-buy-btn {
    background: var(--shopee-gradient-buy);
    color: #fff;
}

.shopee-sticky-buy-btn:hover {
    background: var(--shopee-gradient-hover);
    transform: translateY(-1px);
}

/* Variation Modal */
.shopee-variation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: none;
    align-items: flex-end;
}

.shopee-variation-modal.active {
    display: flex;
}

.shopee-variation-content {
    background: #fff !important;
    width: 100%;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.shopee-variation-modal.active .shopee-variation-content {
    transform: translateY(0);
}

.shopee-variation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.shopee-variation-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.shopee-variation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shopee-variation-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--shopee-primary);
    margin: 0 0 8px 0;
}

.shopee-variation-info p {
    font-size: 14px;
    color: black;
    margin: 0;
}

.shopee-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Attribute Selection */
.shopee-attribute-group {
    margin-bottom: 20px;
}

.shopee-attribute-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.shopee-attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shopee-attribute-option {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 44px;
    text-align: center;
}

.shopee-attribute-option:hover {
    border-color: var(--shopee-primary);
}

.shopee-attribute-option.selected {
    border-color: var(--shopee-primary);
    background: #fef7f6;
    color: var(--shopee-primary);
}

/* Quantity Controls */
.shopee-quantity-section {
    margin: 20px 0;
}

.shopee-quantity-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.shopee-quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shopee-quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.shopee-quantity-btn:hover {
    border-color: var(--shopee-primary);
    color: var(--shopee-primary);
}

.shopee-quantity-input {
    width: 60px;
    height: 32px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    outline: none;
}

.shopee-quantity-input:focus {
    border-color: var(--shopee-primary);
}

/* Modal Actions */
.shopee-modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: var(--shopee-bg-color);
    border-top: 1px solid var(--shopee-border-color);
}

.shopee-modal-btn {
    flex: 1;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.shopee-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.shopee-modal-btn:hover::before {
    left: 100%;
}

.shopee-modal-add-cart {
    background: linear-gradient(135deg, var(--shopee-orange) 0%, #ff6b35 100%);
    border: 2px solid var(--shopee-orange);
    box-shadow: 0 4px 16px rgba(238, 77, 45, 0.2);
}

.shopee-modal-add-cart:hover {
    background: linear-gradient(135deg, #ff6b35 0%, var(--shopee-orange) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(238, 77, 45, 0.4);
}

.shopee-modal-add-cart:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(238, 77, 45, 0.3);
}

.shopee-modal-buy-now {
    background: linear-gradient(135deg, var(--shopee-red) 0%, #d63384 100%);
    border: 2px solid var(--shopee-red);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.2);
}

.shopee-modal-buy-now:hover {
    background: linear-gradient(135deg, #d63384 0%, var(--shopee-red) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.4);
}

.shopee-modal-buy-now:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Loading State */
.shopee-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 480px) {
    .shopee-sticky-cart {
        padding: 10px 12px;
    }
    
    .shopee-sticky-cart-content {
        gap: 10px;
    }
    
    .shopee-sticky-product-image {
        width: 40px;
        height: 40px;
    }
    
    .shopee-sticky-product-name {
        font-size: 13px;
    }
    
    .shopee-sticky-product-price {
        font-size: 15px;
    }
    
    .shopee-sticky-actions {
        gap: 10px;
    }
    
    .shopee-sticky-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .shopee-variation-content {
        padding: 16px;
    }
    
    .shopee-variation-header {
        gap: 10px;
    }
    
    .shopee-variation-image {
        width: 60px;
        height: 60px;
    }
    
    .shopee-variation-info h3 {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .shopee-sticky-cart {
        padding: 8px 10px;
    }
    
    .shopee-sticky-cart-content {
        gap: 8px;
    }
    
    .shopee-sticky-product-image {
        width: 36px;
        height: 36px;
    }
    
    .shopee-sticky-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .shopee-sticky-actions {
        gap: 8px;
    }
}

/* Gallery Modal */
.shopee-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.shopee-gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.shopee-gallery-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 90%;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.shopee-gallery-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.shopee-gallery-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.shopee-gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.shopee-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.shopee-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.shopee-gallery-thumbs::-webkit-scrollbar {
    height: 4px;
}

.shopee-gallery-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.shopee-gallery-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.shopee-gallery-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.shopee-gallery-thumb:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.shopee-gallery-thumb.active {
    border-color: var(--shopee-orange);
    box-shadow: 0 0 10px rgba(238, 77, 45, 0.5);
}

.shopee-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .shopee-sticky-cart {
        border-top-color: #333;
    }
    
    .shopee-sticky-product-name {
        color: #fff;
    }
    
    .shopee-variation-content {
        background: #1a1a1a;
    }
    
    .shopee-attribute-option {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .shopee-quantity-btn,
    .shopee-quantity-input {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
}