/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f3f6;
    color: #212121;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background-color: #2874f0;
    color: white;
    padding: 12px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 20px;
}

.logo-section {
    min-width: 150px;
}

.logo {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.logo-plus {
    font-size: 11px;
    color: #ffe500;
    font-style: italic;
    margin-top: -2px;
}

.logo-plus::before {
    content: "★ ";
    color: #ffe500;
}

/* Search Bar */
.search-section {
    flex: 1;
    max-width: 564px;
}

.search-form {
    display: flex;
    background: white;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    color: #212121;
}

.search-input::placeholder {
    color: #999;
}

.search-button {
    background: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    color: #2874f0;
    font-size: 16px;
    transition: background 0.2s;
}

.search-button:hover {
    background: #f1f3f6;
}

/* Header Right Menu */
.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.header-item:hover {
    opacity: 0.8;
}

.cart-item {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6161;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

/* Navigation Bar */
.nav-bar {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 0 20px;
    overflow-x: auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px 10px;
    min-width: 80px;
    position: relative;
    transition: color 0.2s;
}

.nav-item:hover {
    color: #2874f0;
}

.nav-icon {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f6;
    border-radius: 8px;
    font-size: 24px;
    color: #2874f0;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6161;
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.nav-text {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.nav-arrow {
    position: absolute;
    bottom: 0;
    font-size: 10px;
    color: #999;
}

/* Banner Carousel */
.banner-section {
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.banner-carousel {
    position: relative;
    background: linear-gradient(135deg, #2874f0 0%, #1e5bb8 100%);
    border-radius: 8px;
    overflow: hidden;
    height: 280px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.banner-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.banner-content {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 20px 40px;
    gap: 40px;
}

.banner-image {
    flex: 1;
    max-width: 400px;
}

.banner-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.banner-text {
    flex: 1;
    color: white;
}

.banner-text h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
}

.banner-text p {
    font-size: 18px;
    margin-bottom: 5px;
}

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

.carousel-btn:hover {
    background: rgba(255,255,255,0.5);
}

.carousel-btn-prev {
    left: 15px;
}

.carousel-btn-next {
    right: 15px;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: white;
}

/* Products Section */
.products-section {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #212121;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
}

.product-name {
    font-size: 14px;
    color: #212121;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    font-size: 12px;
}

.rating-stars {
    color: #ffc107;
}

.rating-count {
    color: #999;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.price-current {
    font-size: 18px;
    font-weight: 600;
    color: #212121;
}

.price-original {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.discount-badge {
    background: #26a541;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-quick-view,
.btn-add-cart {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-quick-view {
    background: #f1f3f6;
    color: #2874f0;
}

.btn-quick-view:hover {
    background: #e0e0e0;
}

.btn-add-cart {
    background: #2874f0;
    color: white;
}

.btn-add-cart:hover {
    background: #1e5bb8;
}

/* Skeleton Loader */
.product-skeleton {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.skeleton-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

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

/* Loading States */
.load-more-container {
    text-align: center;
    padding: 30px 0;
}

.load-more-trigger {
    height: 1px;
    margin-bottom: 20px;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #999;
    font-size: 14px;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2874f0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.end-message {
    color: #999;
    font-size: 14px;
    padding: 20px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2874f0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Footer */
.footer {
    background: #172337;
    color: #878787;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    color: #878787;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #2874f0;
}

.footer-bottom {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #3e4555;
    color: #878787;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }

    .search-section {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }

    .header-right {
        gap: 15px;
    }

    .header-item span {
        display: none;
    }

    .nav-container {
        justify-content: flex-start;
        gap: 10px;
    }

    .nav-item {
        min-width: 60px;
    }

    .nav-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .banner-content {
        flex-direction: column;
        padding: 20px;
    }

    .banner-text h2 {
        font-size: 24px;
    }
}

/* Error Messages */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

.error-message button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #2874f0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}




