/**
 * Products Page Styles
 * Sourcing From China - Product Catalog
 * Includes responsive design, product cards, and subcategory menus
 */

/* ============================================
   CSS VARIABLES & RESET
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --green-100: #dcfce7;
    --green-600: #16a34a;
    --yellow-500: #eab308;
    --white: #ffffff;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--white);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================
   HEADER STYLES
   ============================================ */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    min-height: 80px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

 .logo {
            cursor: pointer;
            height: 50px;
        }

.nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav {
        display: flex;
    }
}

.nav a, .nav button {
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 400;
}

.nav a:hover, .nav button:hover {
    color: var(--blue-600);
}

/* ============================================
   DROPDOWN MENU STYLES (WITH SUBMENUS)
   ============================================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    min-width: 14rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-300);
    padding: 0.5rem 0;
    z-index: 50;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    background: var(--blue-50);
    color: var(--blue-600);
}

/* Subcategory Menu Styles */
.dropdown-menu .has-submenu {
    position: relative;
}

.dropdown-menu .has-submenu > a {
    padding-right: 2.5rem;
    position: relative;
}

.dropdown-menu .has-submenu::after {
    content: '›';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: bold;
    color: #6b7280;
    pointer-events: none;
    transition: color 0.2s;
}

.dropdown-menu .has-submenu:hover::after {
    color: #2563eb;
}

.dropdown-menu .submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 220px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    border: 1px solid #e5e7eb;
}

.dropdown-menu .has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-menu .submenu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
}

.dropdown-menu .submenu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #2563eb;
    transition: height 0.2s;
}

.dropdown-menu .submenu a:hover {
    background: #f9fafb;
    color: #2563eb;
    padding-left: 1.75rem;
}

.dropdown-menu .submenu a:hover::before {
    height: 60%;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.btn {
    background: var(--blue-600);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background: var(--blue-700);
}

/* ============================================
   MOBILE MENU STYLES
   ============================================ */

.mobile-menu-btn {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 1.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu {
    position: fixed;
    top: 80px;
    right: 0;
    width: 100%;
    max-width: 300px;
    height: calc(100vh - 80px);
    background: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s;
    overflow-y: auto;
    z-index: 999;
    padding: 1rem;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu a, .mobile-menu button {
    display: block;
    padding: 0.75rem 0;
    color: var(--gray-700);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.mobile-menu a:hover, .mobile-menu button:hover {
    color: var(--blue-600);
}

.mobile-submenu {
    padding-left: 0;
}

.mobile-submenu .submenu-item {
    padding-left: 1.5rem;
    border-left: 3px solid #e5e7eb;
    margin-left: 0.75rem;
    margin-top: 0.25rem;
    position: relative;
}

.mobile-submenu .submenu-item::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #e5e7eb 0%, transparent 100%);
}

.mobile-submenu .submenu-item a {
    display: block;
    padding: 0.6rem 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 0.25rem;
    position: relative;
    padding-left: 1rem;
}

.mobile-submenu .submenu-item a::before {
    content: '└';
    position: absolute;
    left: -0.25rem;
    color: #d1d5db;
    font-size: 12px;
}

.mobile-submenu .submenu-item a:hover {
    color: #2563eb;
    background: #eff6ff;
    padding-left: 1.25rem;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--blue-50), var(--white));
    padding: 4rem 0;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--blue-100);
    color: var(--blue-700);
    border-radius: 2rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 3.5rem;
    }
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */

.products-section {
    padding: 4rem 0;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-link {
    color: var(--blue-600);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--blue-700);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--gray-400);
    user-select: none;
}

.breadcrumb-current {
    color: var(--gray-900);
    font-weight: 500;
}

/* Responsive breadcrumb for mobile */
@media (max-width: 640px) {
    .breadcrumb {
        font-size: 0.8125rem;
        padding: 0.75rem 0;
        margin-bottom: 1.5rem;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.category-tab {
    padding: 0.75rem 1.5rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 0.875rem;
}

.category-tab:hover {
    background: var(--blue-50);
    color: var(--blue-600);
}

.category-tab.active {
    background: var(--blue-600);
    color: white;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--blue-600);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: var(--gray-100);
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--yellow-500);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-content {
    padding: 1.5rem;
}

.product-category {
    font-size: 0.75rem;
    color: var(--blue-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.product-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--blue-600);
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* ============================================
   STATS SECTION
   ============================================ */

.stats-section {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blue-600);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   STATE STYLES (Loading, Error, Empty)
   ============================================ */

.state-container {
    text-align: center;
    padding: 4rem 2rem;
}

.state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.state-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.state-message {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Loading Animation */
.spinner {
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--blue-600);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ============================================
   FOOTER STYLES
   ============================================ */

footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 3rem 0 1.5rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 3rem;
    }
}

/* Brand Column */
.footer-brand {
    margin-bottom: 0;
}

.footer-brand-logo {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-brand-description {
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9375rem;
}

.footer-contact-item:hover {
    color: #ffffff;
}

.footer-contact-item svg {
    flex-shrink: 0;
    color: #3b82f6;
}

/* Links Columns */
.footer-links-column h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links-list a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9375rem;
}

.footer-links-list a:hover {
    color: #ffffff;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-copyright {
    color: #9ca3af;
    font-size: 0.875rem;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-social-link {
    width: 40px;
    height: 40px;
    background: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.3s;
    text-decoration: none;
}

.footer-social-link:hover {
    background: #2563eb;
    color: #ffffff;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 767px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .category-tabs {
        justify-content: flex-start;
    }
    
    .products-grid {
        gap: 1.5rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.dropdown-menu a:focus,
.mobile-submenu .submenu-item a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   SEARCH SECTION STYLES
   ============================================ */

.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.category-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
}

.category-select:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.category-select:hover {
    border-color: var(--blue-600);
}

.price-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    padding: 0 0.75rem;
    transition: border-color 0.3s;
    flex-shrink: 0;
}

.price-filter:focus-within {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.price-filter-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    white-space: nowrap;
    font-weight: 500;
}

.price-input {
    width: 72px;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 0.65rem 0.25rem;
    color: var(--gray-900);
    background: transparent;
    -moz-appearance: textfield;
}

.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-filter-sep {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.price-filter-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.85rem;
    padding: 0.25rem;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.price-filter-clear:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

/* ============================================
   PAGINATION STYLES
   ============================================ */

.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    min-width: 2.5rem;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--blue-600);
    color: var(--blue-600);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.page-number.active {
    background: var(--blue-600);
    color: white;
    border-color: var(--blue-600);
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: var(--gray-400);
}

/* Mobile responsive adjustments for pagination */
@media (max-width: 640px) {
    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: 2rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
        text-align: center;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .search-input,
    .category-select {
        width: 100%;
    }

    .price-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .price-input {
        flex: 1;
        min-width: 0;
    }
}
/* ============================================
   HEADER CTA FIXES (July 2026) — same as home.css
   ============================================ */

.header-content {
    flex-wrap: nowrap;
    height: 80px;
    min-height: 80px;
}

.header-left { min-width: 0; }
.logo { flex-shrink: 0; }

.desktop-cta {
    background: #2563eb;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.desktop-cta[href*="wa.me"] {
    background: #25D366;
    display: inline-flex !important;
    flex-shrink: 0;
}

.desktop-cta[href*="wa.me"]:hover { background: #20ba58; }

@media (max-width: 767px) {
    .desktop-cta:not([href*="wa.me"]) { display: none !important; }

    .desktop-cta[href*="wa.me"] {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
        margin-left: auto !important;
        margin-right: 0.75rem;
    }

    .desktop-cta[href*="wa.me"] svg {
        width: 16px;
        height: 16px;
    }
}
