/* Comprehensive Fixes for G.AZ Fashions */

/* 1. DESKTOP CART ICON FIX */
@media (min-width: 992px) {
    .enhanced-header .cart-link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 10px !important;
        background: rgba(255, 107, 53, 0.1) !important;
        color: #D4AF37 !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        border: 2px solid transparent !important;
    }
    
    .enhanced-header .cart-link:hover {
        background: #D4AF37 !important;
        color: white !important;
        transform: translateY(-3px) !important;
        box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3) !important;
        border-color: #D4AF37 !important;
    }
    
    .enhanced-header .cart-link i {
        font-size: 1.3rem !important;
    }
    
    .enhanced-header .cart-link .cart-count {
        position: absolute !important;
        top: -8px !important;
        right: -8px !important;
        font-size: 0.7rem !important;
        padding: 0.3rem 0.5rem !important;
        border-radius: 20px !important;
        background: linear-gradient(135deg, #dc3545, #c82333) !important;
        color: white !important;
        border: 3px solid white !important;
        box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4) !important;
        min-width: 22px !important;
        height: 22px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 700 !important;
        animation: cartPulse 2s ease-in-out infinite !important;
    }
}

/* 2. MOBILE PRODUCT GRID FIXES - MAINTAIN 3 COLUMNS */
@media (max-width: 767.98px) {
    .products-grid,
    .products-grid-vertical,
    .clearance-carousel,
    .latest-carousel {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .product-card,
    .clearance-card,
    .latest-card,
    .mobile-product-card {
        width: 100% !important;
        min-height: 200px !important;
        display: flex !important;
        flex-direction: column !important;
        background: white !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        transition: transform 0.3s ease !important;
    }
    
    .product-card:hover,
    .clearance-card:hover,
    .latest-card:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.15) !important;
    }
    
    .product-image-wrapper,
    .clearance-image-container,
    .latest-image-container {
        position: relative !important;
        height: 110px !important;
        overflow: hidden !important;
        background: #f8f9fa !important;
    }
    
    .product-image,
    .clearance-image,
    .latest-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        transition: transform 0.3s ease !important;
    }
    
    .product-info,
    .clearance-info,
    .latest-info {
        padding: 8px !important;
        flex-grow: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .product-title,
    .clearance-title,
    .latest-title {
        font-size: 12px !important;
        font-weight: 600 !important;
        margin-bottom: 4px !important;
        line-height: 1.2 !important;
        height: 28px !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }
    
    .product-price,
    .clearance-price,
    .latest-price {
        font-size: 11px !important;
        font-weight: 700 !important;
        color: #D4AF37 !important;
        margin-bottom: 6px !important;
    }
    
    .add-to-cart-btn {
        font-size: 10px !important;
        padding: 4px 8px !important;
        border-radius: 4px !important;
        background: #D4AF37 !important;
        color: white !important;
        border: none !important;
        transition: all 0.3s ease !important;
        width: 100% !important;
    }
    
    .add-to-cart-btn:hover {
        background: #e55a2b !important;
        transform: translateY(-1px) !important;
    }
}

/* 3. SCROLL TO TOP BUTTON */
.scroll-to-top {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #D4AF37, #D4AF37);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #e55a2b, #e8851c);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

@media (max-width: 767.98px) {
    .scroll-to-top {
        bottom: 120px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* 4. HOMEPAGE PRODUCT CENTERING */
.products-section,
.clearance-section,
.latest-products-section {
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2rem 0 !important;
    background: #f8f9fa !important;
}

.products-section .container,
.clearance-section .container,
.latest-products-section .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
}

.section-header {
    text-align: center !important;
    margin-bottom: 2rem !important;
}

.section-title {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #333 !important;
    margin-bottom: 0.5rem !important;
}

.section-subtitle {
    color: #666 !important;
    font-size: 1.1rem !important;
}

/* 5. IMPROVED CART LAYOUT */
.cart-header {
    margin-bottom: 2rem !important;
}

.cart-title {
    color: #333 !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
}

.text-orange {
    color: #D4AF37 !important;
}

.cart-items-section {
    margin-bottom: 2rem;
}

.cart-item-card {
    background: white !important;
    border: none !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08) !important;
    border-radius: 15px !important;
    transition: all 0.3s ease !important;
    margin-bottom: 1.5rem !important;
    overflow: hidden !important;
}

.cart-item-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.15) !important;
}

.cart-item-content {
    padding: 1.5rem !important;
}

/* Mobile Cart Layout */
.mobile-cart-layout {
    display: block !important;
}

.mobile-cart-row {
    display: flex !important;
    align-items: flex-start !important;
    margin-bottom: 1rem !important;
    gap: 1rem !important;
}

.mobile-cart-layout .product-image-container {
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #f8f9fa !important;
    border: 2px solid #e9ecef !important;
}

.mobile-cart-layout .product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.mobile-cart-layout .image-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #999 !important;
    font-size: 1.5rem !important;
}

.product-details-mobile {
    flex: 1 !important;
}

.product-details-mobile .product-name {
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.25rem !important;
    color: #333 !important;
}

.product-details-mobile .product-category {
    font-size: 0.875rem !important;
    color: #666 !important;
    margin-bottom: 0.25rem !important;
}

.product-color {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #666 !important;
    margin-bottom: 0.5rem !important;
}

.color-dot {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    border: 1px solid #ddd !important;
}

.price-total-mobile {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.unit-price {
    font-size: 0.875rem !important;
    color: #666 !important;
}

.total-price {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #D4AF37 !important;
}

.mobile-cart-controls {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 1rem !important;
    border-top: 1px solid #eee !important;
}

/* Desktop Cart Layout */
.desktop-cart-layout {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

.desktop-cart-layout .product-image-container.desktop {
    width: 100px !important;
    height: 100px !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #f8f9fa !important;
    border: 2px solid #e9ecef !important;
}

.desktop-cart-layout .product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.product-details-desktop {
    flex: 1 !important;
    min-width: 200px !important;
}

.product-details-desktop .product-name {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    color: #333 !important;
}

.product-details-desktop .product-category {
    font-size: 0.875rem !important;
    color: #666 !important;
    margin-bottom: 0.25rem !important;
}

.price-column,
.quantity-column,
.total-column,
.actions-column {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 100px !important;
}

.price-column .unit-price {
    font-size: 1rem !important;
    color: #666 !important;
    font-weight: 500 !important;
}

.total-column .total-price {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #D4AF37 !important;
}

/* Quantity Controls */
.quantity-control-group {
    display: flex !important;
    align-items: center !important;
    border: 2px solid #e9ecef !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.quantity-btn {
    border: none !important;
    background: #f8f9fa !important;
    color: #D4AF37 !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
}

.quantity-btn:hover {
    background: #D4AF37 !important;
    color: white !important;
}

.quantity-btn:disabled {
    background: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
}

.quantity-input {
    border: none !important;
    text-align: center !important;
    font-weight: 600 !important;
    background: white !important;
    width: 60px !important;
    padding: 0.5rem 0.25rem !important;
    font-size: 0.875rem !important;
}

.quantity-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove Button */
.remove-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    background: #dc3545 !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

.remove-btn:hover {
    background: #c82333 !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
}

.actions-column .remove-btn {
    padding: 0.5rem !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    justify-content: center !important;
}

.actions-column .remove-btn span {
    display: none !important;
}

/* Mobile specific adjustments */
@media (max-width: 991.98px) {
    .mobile-cart-controls .quantity-control-group {
        max-width: 140px !important;
    }
    
    .mobile-cart-controls .remove-btn {
        flex-shrink: 0 !important;
    }
}

.order-summary-card {
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    border-radius: 15px !important;
    position: sticky !important;
    top: 120px !important;
}

.order-summary-card .card-header {
    background: linear-gradient(135deg, #D4AF37, #D4AF37) !important;
    color: white !important;
    border: none !important;
    border-radius: 15px 15px 0 0 !important;
    padding: 1.25rem !important;
}

.summary-row {
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid #e9ecef !important;
}

.summary-row:last-child {
    border-bottom: none !important;
    font-size: 1.1rem !important;
}

.summary-total {
    color: #D4AF37 !important;
    font-size: 1.3rem !important;
}

.checkout-btn {
    background: linear-gradient(135deg, #D4AF37, #D4AF37) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 1rem !important;
    font-weight: 600 !important;
    margin-top: 1rem !important;
    transition: all 0.3s ease !important;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #e55a2b, #e8851c) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3) !important;
}

/* 6. BETTER ARROW STYLING FOR NAVIGATION */
.subcategory-nav .scroll-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #D4AF37, #D4AF37) !important;
    color: white !important;
    border: none !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3) !important;
    transition: all 0.3s ease !important;
}

.subcategory-nav .scroll-btn:hover {
    background: linear-gradient(135deg, #e55a2b, #e8851c) !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4) !important;
}

.subcategory-nav .scroll-btn:disabled {
    background: #ddd !important;
    color: #999 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* 7. EMPTY CART STYLING IMPROVEMENTS */
.empty-cart {
    text-align: center !important;
    padding: 4rem 2rem !important;
    background: #f8f9fa !important;
    border-radius: 15px !important;
    margin: 2rem 0 !important;
}

.empty-cart i {
    color: #ddd !important;
    margin-bottom: 1rem !important;
}

.empty-cart h4 {
    color: #333 !important;
    margin-bottom: 1rem !important;
}

.empty-cart p {
    color: #666 !important;
    margin-bottom: 2rem !important;
}

/* 8. MOBILE CART OPTIMIZATIONS */
@media (max-width: 767.98px) {
    .cart-item-card .row {
        margin: 0 !important;
    }
    
    .cart-item-card .row > div {
        padding: 0.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .cart-item-card .product-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .quantity-control-group {
        max-width: 120px !important;
        margin: 0 auto !important;
    }
    
    .order-summary-card {
        position: static !important;
        margin-top: 2rem !important;
    }
}

/* 9. ANIMATION KEYFRAMES */
@keyframes cartPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 10. RESPONSIVE IMPROVEMENTS */
@media (min-width: 768px) and (max-width: 991.98px) {
    .products-grid,
    .clearance-carousel,
    .latest-carousel {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }
}

@media (min-width: 992px) {
    .products-grid,
    .clearance-carousel,
    .latest-carousel {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
        padding: 1.5rem !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
    }
}

/* 11. CART COUNTER JAVASCRIPT ERROR FIX */
.cart-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cart-count:empty {
    display: none !important;
}

/* 12. IMPROVED CLICKABLE LOGO AND BRAND */
.brand-section {
    flex-shrink: 0 !important;
    margin-right: 2rem !important;
}

.brand-link {
    padding: 0.5rem !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.brand-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    transition: left 0.5s ease;
}

.brand-link:hover::before {
    left: 100%;
}

.brand-link:hover {
    background: rgba(255, 107, 53, 0.05) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.15) !important;
}

.logo-container {
    margin-right: 0.75rem !important;
    transition: transform 0.3s ease !important;
}

.brand-link:hover .logo-container {
    transform: scale(1.05) !important;
}

.logo-image {
    height: 45px !important;
    width: auto !important;
    max-width: 120px !important;
    transition: all 0.3s ease !important;
    display: block !important;
    object-fit: contain !important;
    background: transparent !important;
    border-radius: 8px !important;
}

.brand-text-container {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.brand-text {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #000 !important;
    transition: color 0.3s ease !important;
    line-height: 1.2 !important;
}

.brand-tagline {
    font-size: 0.75rem !important;
    color: #000 !important;
    margin: 0 !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: color 0.3s ease !important;
}

.brand-link:hover .brand-text {
    color: #D4AF37 !important;
}

.brand-link:hover .brand-tagline {
    color: #333 !important;
}

/* Sidebar Brand Styling */
.sidebar-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    color: inherit !important;
}

.sidebar-logo:hover {
    background: rgba(255, 107, 53, 0.1) !important;
    transform: translateX(5px) !important;
}

.sidebar-logo img {
    height: 35px !important;
    width: auto !important;
    max-width: 100px !important;
    transition: transform 0.3s ease !important;
    object-fit: contain !important;
    border-radius: 6px !important;
}

.sidebar-logo:hover img {
    transform: scale(1.1) !important;
}

.sidebar-brand-text h1 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #333 !important;
    line-height: 1.2 !important;
}

.sidebar-brand-text p {
    font-size: 0.7rem !important;
    color: #D4AF37 !important;
    margin: 0 !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

/* Mobile Responsive Brand */
@media (max-width: 991.98px) {
    .brand-text {
        font-size: 1.2rem !important;
    }
    
    .brand-tagline {
        font-size: 0.65rem !important;
    }
    
    .logo-image {
        height: 40px !important;
    }
    
    .brand-section {
        margin-right: 1rem !important;
    }
}

@media (max-width: 767.98px) {
    .brand-text {
        font-size: 1rem !important;
    }
    
    .brand-tagline {
        display: none !important;
    }
    
    .logo-image {
        height: 35px !important;
    }
    
    .brand-link {
        padding: 0.25rem !important;
    }
}