/* ============================================
   UNITRADE - HOME PAGE STYLES (FIXED)
   ============================================ */

/* ==================== 1. HERO CAROUSEL ==================== */
.hero-carousel {
    position: relative;
    width: 100%;
    min-height: 400px;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    min-height: 400px;
}

.carousel-slide.active {
    opacity: 1;
    position: relative;
}

.carousel-content {
    text-align: center;
    color: var(--white);
    max-width: 600px;
    width: 100%;
}

.carousel-content h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.carousel-content p {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.carousel-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.carousel-indicators {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
}

.carousel-indicator.active {
    background: var(--white);
    width: 30px;
    border-radius: 5px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.carousel-nav-prev {
    left: 1rem;
}

.carousel-nav-next {
    right: 1rem;
}

/* ==================== 2. SEARCH SECTION (FIXED: 2x1 GRID) ==================== */
.search-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-2xl);
    border: 3px solid var(--primary-purple);
    margin-bottom: 3rem;
}

.search-form {
    display: grid;
    grid-template-columns: 3fr 1fr; /* FIXED: Input takes 3/4, button takes 1/4 */
    gap: 1rem;
    width: 100%;
}

.search-input {
    padding: 1rem 1.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.search-button {
    padding: 1rem 1.5rem;
    background: var(--primary-purple);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    width: 100%;
}

.search-button:hover {
    background: var(--primary-purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
}

.search-help-text {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* ==================== SECTION HEADER ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    font-size: 1.5rem;
    color: var(--primary-purple);
}

.section-link {
    color: var(--primary-purple);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.section-link:hover {
    gap: 0.75rem;
}

/* ==================== HORIZONTAL SCROLL (FIXED) ==================== */
.horizontal-scroll {
    display: flex;
    flex-direction: row; /* FIXED: Force horizontal layout */
    gap: 1.25rem;
    overflow-x: auto;
    overflow-y: hidden; /* FIXED: Prevent vertical scroll */
    padding: 0.5rem 0.25rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) var(--gray-200);
}

.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: var(--gray-200);
    border-radius: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple-dark);
}

/* ==================== 3. PRODUCTS SECTION (FIXED) ==================== */
.products-section {
    margin-bottom: 3rem;
}

.product-card {
    flex: 0 0 260px; /* FIXED: Fixed width, no grow, no shrink */
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 3px solid var(--primary-purple);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column; /* Card content is vertical */
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.15);
}

.product-image-wrapper {
    position: relative;
    height: 180px;
    background: var(--gray-100);
    overflow: hidden;
    flex-shrink: 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 3.5rem;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8rem; /* Fixed height for 2 lines */
}

.product-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.product-seller {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: auto; /* Push button to bottom */
    padding-bottom: 0.75rem;
}

/* ==================== 4. SERVICES SECTION (FIXED) ==================== */
.services-section {
    margin-bottom: 3rem;
}

.service-card {
    flex: 0 0 260px; /* FIXED: Fixed width, no grow, no shrink */
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 3px solid var(--primary-purple);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column; /* Card content is vertical */
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.15);
}

.service-image-wrapper {
    position: relative;
    height: 140px;
    background: var(--gray-100);
    overflow: hidden;
    flex-shrink: 0;
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3.5rem;
}

.service-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.service-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8rem; /* Fixed height for 2 lines */
}

.service-seller {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.service-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: auto; /* Push button to bottom */
    padding-bottom: 0.75rem;
}

.service-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.service-meta-item i {
    color: var(--primary-purple);
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

/* ==================== VIEW BUTTON ==================== */
.view-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-purple);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    margin-top: auto; /* Stick to bottom */
}

.view-button:hover {
    background: var(--primary-purple-dark);
    transform: translateY(-2px);
}

/* ==================== 5. FLASH SALES SECTION (ENHANCED) ==================== */
.flash-sales-section {
    background: linear-gradient(135deg, #FF9F1C 0%, #FFCC00 25%, #FF9F1C 50%, #FFCC00 75%, #FF9F1C 100%);
    background-size: 400% 100%;
    animation: gradientFlow 8s ease infinite;
    padding: 3.5rem 2rem;
    border-radius: var(--radius-2xl);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.flash-sales-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.flash-sales-content {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.flash-icon {
    font-size: 4rem;
    color: var(--white);
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.flash-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.flash-subtitle {
    font-size: 1.125rem;
    color: var(--white);
    opacity: 0.95;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.coming-soon-badge {
    display: inline-block;
    background: var(--white);
    color: #FF9F1C;
    padding: 0.75rem 2.5rem;
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==================== 6. CTA CARD (ENHANCED) ==================== */
.cta-card {
    background: var(--white);
    border: 3px solid var(--primary-purple);
    border-radius: var(--radius-2xl);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.cta-text {
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.cta-buttons {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    min-width: 200px;
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    .hero-carousel {
        min-height: 350px;
    }
    
    .carousel-slide {
        padding: 2rem 1.5rem;
        min-height: 350px;
    }
    
    .carousel-content h2 {
        font-size: 1.75rem;
    }
    
    .carousel-content p {
        font-size: 1rem;
    }
    
    .carousel-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .carousel-buttons .btn {
        width: 100%;
    }
    
    .search-section {
        padding: 1.5rem;
    }
    
    .search-form {
        grid-template-columns: 2fr 1fr; /* Adjust ratio on mobile */
    }
    
    .search-button span {
        display: none; /* Hide "Search" text on mobile, show icon only */
    }
    
    .search-button {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .section-title i {
        font-size: 1.25rem;
    }
    
    .product-card,
    .service-card {
        flex: 0 0 220px;
    }
    
    .flash-icon {
        font-size: 3rem;
    }
    
    .flash-title {
        font-size: 2rem;
    }
    
    .flash-subtitle {
        font-size: 1rem;
    }
    
    .cta-card {
        padding: 2rem 1.5rem;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
    
    .cta-text {
        font-size: 0.95rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cta-buttons .btn {
        width: 100%;
        min-width: auto;
    }

    .carousel-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-carousel {
        min-height: 300px;
    }
    
    .carousel-slide {
        padding: 1.5rem 1rem;
        min-height: 300px;
    }
    
    .carousel-content h2 {
        font-size: 1.5rem;
    }
    
    .carousel-content p {
        font-size: 0.95rem;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 0.875rem 1.25rem;
    }
    
    .search-button {
        padding: 0.875rem;
    }
    
    .product-card,
    .service-card {
        flex: 0 0 200px;
    }
    
    .product-image-wrapper,
    .service-image-wrapper {
        height: 150px;
    }
}