/* home-sections.css - Homepage Section Styles */

/* ===== Horizontal Scroll Sections (Top Deals & Featured Products) ===== */
.horizontal-scroll-section {
    margin: 2rem 0;
    padding: 1rem 0;
    position: relative;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.section-title {
    font-size: 1.5rem;
    color: var(--forest);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--bronze);
}

.view-all {
    color: var(--forest);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
}

.view-all:hover {
    color: var(--bronze);
    gap: 0.5rem;
}

/* Horizontal scroll container */
.scroll-container {
    position: relative;
    padding: 0 1rem;
}

.scroll-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bronze) transparent;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scroll-track::-webkit-scrollbar {
    height: 6px;
}

.scroll-track::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-track::-webkit-scrollbar-thumb {
    background-color: var(--bronze);
    border-radius: 3px;
}

/* Scroll card styling (for Top Deals & Featured Products) */
.scroll-card {
    flex: 0 0 auto;
    width: 220px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.scroll-card-link,
.new-arrivals-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.scroll-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.scroll-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}

.scroll-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.scroll-card:hover .scroll-card-image img {
    transform: scale(1.05);
}

/* Badges for Top Deals */
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--forest);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.badge.deal {
    background: #dc3545;
}

.badge.featured {
    background: var(--bronze);
}

.badge.new {
    background: #28a745;
}

.scroll-card-info {
    padding: 1rem;
}

.scroll-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--forest);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.scroll-card-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--forest);
}

.original-price {
    font-size: 0.9rem;
    color: #888;
    text-decoration: line-through;
}

.scroll-card-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}

.stars {
    color: #ffc107;
}

.rating-count {
    font-size: 0.85rem;
    color: #666;
}

.scroll-card-actions {
    display: block;
    padding: 0 1rem 1rem;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--forest);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.3s ease;
}

.add-to-cart-btn:hover {
    background: var(--bronze);
}

.add-to-cart-btn:disabled,
.btn-cart:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.add-to-cart-btn:disabled:hover,
.btn-cart:disabled:hover {
    background: #9ca3af;
}

/* Navigation buttons for horizontal scroll */
.scroll-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 2px solid var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scroll-nav:hover {
    background: var(--forest);
    color: white;
    border-color: var(--forest);
}

.scroll-nav.prev {
    left: 0;
}

.scroll-nav.next {
    right: 0;
}

.scroll-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--light);
}

.scroll-nav:disabled:hover {
    background: var(--light);
    color: inherit;
    border-color: var(--light);
}

/* ===== New Arrivals Grid (like products.html) ===== */
.new-arrivals-section {
    margin: 3rem 0;
    padding: 0 1rem;
}

.new-arrivals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.new-arrivals-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.new-arrivals-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.new-arrivals-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.new-arrivals-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.new-arrivals-card:hover .new-arrivals-image img {
    transform: scale(1.05);
}

.new-arrivals-info {
    padding: 1.2rem;
}

.new-arrivals-category {
    font-size: 0.8rem;
    color: var(--bronze);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.new-arrivals-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--forest);
    margin-bottom: 0.8rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.new-arrivals-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.new-arrivals-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.new-arrivals-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--forest);
}

.new-arrivals-stock {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

.new-arrivals-stock.in-stock {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.new-arrivals-stock.low-stock {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.new-arrivals-stock.out-of-stock {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.new-arrivals-actions {
    display: block;
    padding: 0 1.2rem 1.2rem;
}

.btn-cart {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-cart {
    background: var(--forest);
    color: white;
    border: none;
}

.btn-cart:hover {
    background: var(--bronze);
}

/* ===== Deal Countdown ===== */
.deal-countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    font-size: 0.9rem;
    color: #dc3545;
    font-weight: 600;
    background: rgba(220, 53, 69, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

/* ===== Empty States ===== */
.empty-section {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    background: var(--light);
    border-radius: 10px;
    margin: 1rem;
}

.empty-section i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-section h3 {
    margin-bottom: 0.5rem;
    color: #555;
}

.empty-section p {
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

/* ===== Loading States ===== */
.category-count {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    margin-top: 0.2rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.category-count-loading {
    width: 7.2rem;
    border-radius: 999px;
    color: transparent;
    background: linear-gradient(110deg, rgba(17, 62, 33, 0.08) 8%, rgba(179, 139, 89, 0.22) 18%, rgba(17, 62, 33, 0.08) 33%);
    background-size: 220% 100%;
    animation: shimmerText 1.45s linear infinite;
}

.loading-section {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.25rem 0;
}

.loading-rail {
    gap: 1rem;
}

.loading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding-top: 0.25rem;
}

.loading-card-skeleton {
    flex: 0 0 auto;
    width: 220px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250,248,244,0.94));
    border: 1px solid rgba(17, 62, 33, 0.08);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(17, 62, 33, 0.08);
}

.loading-grid-card {
    width: 100%;
}

.loading-card-media {
    height: 160px;
    background:
        radial-gradient(circle at top right, rgba(244, 182, 109, 0.28), transparent 30%),
        linear-gradient(135deg, rgba(17, 62, 33, 0.12), rgba(179, 139, 89, 0.12));
}

.loading-card-body {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
}

.loading-card-action {
    height: 2.8rem;
    margin: 0 1rem 1rem;
    border-radius: 999px;
    background: linear-gradient(110deg, rgba(17, 62, 33, 0.12), rgba(179, 139, 89, 0.28), rgba(17, 62, 33, 0.12));
}

@keyframes shimmerText {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .view-all {
        align-self: flex-start;
    }
    
    .scroll-card {
        width: 200px;
    }
    
    .new-arrivals-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .loading-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .new-arrivals-image {
        height: 180px;
    }
    
    .scroll-nav {
        display: none;
    }
    
    .deal-countdown {
        margin-left: 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .scroll-container {
        padding: 0 0.5rem;
    }

    .scroll-track {
        gap: 0.5rem;
    }

    .scroll-card {
        width: calc((100vw - 2.5rem) / 3);
        min-width: calc((100vw - 2.5rem) / 3);
    }

    .loading-card-skeleton {
        width: calc((100vw - 2.5rem) / 3);
        min-width: calc((100vw - 2.5rem) / 3);
    }

    .scroll-card-image {
        height: 108px;
    }

    .loading-card-media {
        height: 108px;
    }

    .scroll-card-info {
        padding: 0.65rem;
    }

    .scroll-card-name {
        font-size: 0.82rem;
        margin-bottom: 0.35rem;
    }

    .current-price {
        font-size: 0.95rem;
    }

    .original-price {
        font-size: 0.72rem;
    }

    .scroll-card-rating {
        margin-bottom: 0.45rem;
    }

    .rating-count {
        font-size: 0.72rem;
    }

    .scroll-card-actions {
        display: block;
    }

    .add-to-cart-btn {
        font-size: 0.72rem;
        padding: 0.45rem;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .new-arrivals-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .loading-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .new-arrivals-image {
        height: 120px;
    }

    .new-arrivals-info {
        padding: 0.65rem;
    }

    .new-arrivals-category {
        font-size: 0.62rem;
        margin-bottom: 0.3rem;
    }

    .new-arrivals-name {
        font-size: 0.82rem;
        margin-bottom: 0.4rem;
    }

    .new-arrivals-description {
        font-size: 0.72rem;
        margin-bottom: 0.5rem;
        height: 2.6em;
    }

    .new-arrivals-price {
        font-size: 0.95rem;
    }

    .new-arrivals-stock {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .new-arrivals-actions {
        display: block;
    }

    .btn-cart {
        font-size: 0.7rem;
        padding: 0.45rem;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .scroll-container {
        padding: 0 0.35rem;
    }

    .scroll-track {
        gap: 0.4rem;
    }

    .scroll-card {
        width: calc((100vw - 1.9rem) / 3);
        min-width: calc((100vw - 1.9rem) / 3);
    }

    .loading-card-skeleton {
        width: calc((100vw - 1.9rem) / 3);
        min-width: calc((100vw - 1.9rem) / 3);
    }
    
    .scroll-card-image {
        height: 92px;
    }

    .loading-card-media {
        height: 92px;
    }

    .scroll-card-info {
        padding: 0.5rem;
    }

    .scroll-card-name {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .current-price {
        font-size: 0.82rem;
    }

    .original-price {
        font-size: 0.66rem;
    }
    
    .new-arrivals-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }
    
    .new-arrivals-image {
        height: 98px;
    }

    .new-arrivals-info {
        padding: 0.5rem;
    }

    .new-arrivals-category {
        font-size: 0.56rem;
        margin-bottom: 0.22rem;
    }
    
    .new-arrivals-name {
        font-size: 0.72rem;
        margin-bottom: 0.3rem;
    }

    .new-arrivals-description {
        display: none;
    }
    
    .new-arrivals-price {
        font-size: 0.82rem;
    }
    
    .new-arrivals-stock {
        font-size: 0.58rem;
        padding: 0.16rem 0.34rem;
    }

    .btn-cart {
        font-size: 0.62rem;
        padding: 0.36rem;
        gap: 0.2rem;
    }
    
    .scroll-card-actions {
        display: block;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.horizontal-scroll-section,
.new-arrivals-section {
    animation: fadeIn 0.5s ease-out;
}

.scroll-card.is-unavailable,
.new-arrivals-card.is-unavailable {
    opacity: 0.94;
}

/* ===== Custom Scrollbar for Firefox ===== */
.scroll-track {
    scrollbar-color: var(--bronze) transparent;
}
