/* Apple-style Design for SmartCart Theme */

/* Box 1: Categories & Featured Slider */
.box-categories-slider .box-inner {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    padding: 0;
    background: transparent;
}

/* Categories Menu - Apple Style */
.categories-menu-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 
                0 10px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.categories-menu {
    padding: 0;
}

.categories-title {
    background: linear-gradient(135deg, var(--light-purple), var(--light-orange));
    color: white;
    padding: 16px 20px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.categories-title svg {
    opacity: 0.9;
}

.category-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.category-item {
    position: relative;
    margin: 0;
    border: none;
}

.category-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #1d1d1f;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.category-link:hover {
    background: rgba(123, 104, 238, 0.08);
    color: var(--primary-purple);
}

.category-icon {
    font-size: 20px;
    margin-right: 12px;
    opacity: 0.9;
}

.category-name {
    flex: 1;
    letter-spacing: 0.2px;
}

.category-arrow {
    color: #86868b;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.category-link:hover .category-arrow {
    transform: translateX(3px);
    color: var(--primary-purple);
}

/* Subcategory Panel - Apple Dropdown Style */
.subcategory-panel {
    position: absolute;
    left: 100%;
    top: 0;
    width: 240px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.category-item:hover .subcategory-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(10px);
}

.subcategory-header {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
}

.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subcategory-list li {
    margin: 0;
}

.subcategory-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.subcategory-list a:hover {
    background: rgba(255, 107, 53, 0.08);
    color: var(--primary-orange);
}

.sub-count {
    font-size: 12px;
    color: #86868b;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Featured Products Slider - Apple Style */
.featured-slider-wrapper {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 
                0 10px 15px rgba(0, 0, 0, 0.08);
}

.featured-products-slider {
    position: relative;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.slider-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: 0.2px;
}

.slider-controls {
    display: flex;
    gap: 8px;
}

.slider-controls .slider-nav {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: static;
    transform: none;
}

.slider-controls .slider-nav:hover {
    background: var(--primary-purple);
    color: white;
}

.slider-controls .slider-nav svg {
    width: 20px;
    height: 20px;
}

.slider-viewport {
    overflow: hidden;
    border-radius: 12px;
}

.featured-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-image-wrapper {
    position: relative;
    width: 80px;
    height: 120px;
    overflow: hidden;
    background: #f5f5f7;
    margin: 0 auto;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 2/3;
    max-height: 120px;
    transition: transform 0.3s ease;
}

.featured-product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

.sale-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b35, #ff9558);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.featured-product-card .product-info {
    padding: 16px;
}

.featured-product-card .product-title {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-product-card .product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-product-card .regular-price {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
    text-decoration: line-through;
    font-weight: normal;
}

.featured-product-card .sale-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-orange);
}

/* Fix overflow issues for all boxes */
.home-box {
    margin-bottom: 30px;
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 
                0 10px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 100%;
}

.flash-sale {
    background: white;
    padding: 20px;
    border-radius: 16px;
}

.flash-sale-header {
    background: linear-gradient(135deg, #ff6b35, #ffb088);
    margin: -20px -20px 20px -20px;
    padding: 20px;
    border-radius: 16px 16px 0 0;
}

.flash-sale-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.countdown {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Products Grid - Fix Overflow */
.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin: 0;
    padding: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.product-item {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.product-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.product-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Section Headers - Apple Style */
.section-header {
    background: linear-gradient(90deg, var(--primary-purple), var(--primary-orange));
    color: white;
    padding: 16px 24px;
    margin: -20px -20px 20px -20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.view-all {
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-all:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
}

/* Box Category Styles */
.box-category {
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .box-categories-slider .box-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .categories-menu-wrapper {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        padding: 10px !important;
        max-width: 100%;
    }
    
    .product-item {
        padding: 6px;
    }
    
    .product-item .product-image-wrapper,
    .product-item img {
        width: 100%;
        aspect-ratio: 2/3;  /* 60x90 ratio */
        object-fit: cover;
    }
    
    .content-area {
        max-width: 100%;
        margin-right: 0;
        padding: 0 10px;
    }
    
    .site-content {
        flex-direction: column;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .home-box {
        padding: 15px;
        margin: 0 10px 20px;
    }
    
    .featured-slider-wrapper {
        padding: 15px;
    }
    
    .featured-products-slider .slider-item {
        flex: 0 0 100%;
    }
    
    .featured-product-card .product-image-wrapper {
        width: 80px;
        height: 120px;
        margin: 0 auto;
    }
    
    .section-header {
        margin: -15px -15px 15px -15px;
        padding: 12px 20px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
        padding: 5px !important;
    }
    
    .product-item {
        padding: 4px;
    }
    
    .product-item .product-image-wrapper,
    .product-item img {
        width: 100%;
        aspect-ratio: 2/3;  /* 60x90 ratio */
        object-fit: cover;
    }
    
    .product-item .product-title {
        font-size: 10px;
        line-height: 1.2;
        min-height: 24px;
    }
    
    .home-box {
        border-radius: 8px;
        margin: 0 5px 15px;
        padding: 10px;
    }
    
    .section-header {
        margin: -10px -10px 10px -10px;
        padding: 10px 15px;
    }
    
    .section-title {
        font-size: 14px;
    }
    
    .view-all {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    /* Featured products slider mobile */
    .slider-header h3 {
        font-size: 16px;
    }
    
    .slider-controls .slider-nav {
        width: 30px;
        height: 30px;
    }
    
    .featured-product-card .product-title {
        font-size: 12px;
    }
    
    .featured-product-card .product-price {
        font-size: 11px;
    }
}