* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Header Styles */
.header {
    background: white;
    padding: 0 20px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: #f39c12;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #f39c12;
}

.nav-link.active {
    color: #f39c12;
    border-bottom: 2px solid #f39c12;
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e67e22;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

/* Hero Section with Orange Background */
.hero {
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2a 100%);
    position: relative;
    overflow: hidden;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" fill-opacity="1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.15;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
    color: white;
    font-weight: 700;
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 25px;
    color: rgba(255,255,255,0.95);
}

/* Search Container */
.search-container {
    max-width: 700px;
    margin: 30px auto 0;
    position: relative;
}

.search-wrapper {
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s;
}

.search-wrapper:focus-within {
    transform: translateY(-2px);
}

.search-icon {
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #7f8c8d;
}

.search-input {
    flex: 1;
    border: none;
    padding: 18px 0;
    font-size: 16px;
    outline: none;
}

.search-input::placeholder {
    color: #bdc3c7;
}

.search-btn {
    background: #ff6b35;
    border: none;
    color: white;
    padding: 0 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #e55a2a;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    margin-top: 10px;
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-suggestions.active {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.suggestions-section {
    padding: 10px 0;
}

.suggestions-title {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: #7f8c8d;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.suggestion-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item i {
    width: 20px;
    color: #ff6b35;
    font-size: 14px;
}

.suggestion-item .suggestion-text {
    flex: 1;
}

.suggestion-item .suggestion-category {
    font-size: 11px;
    color: #7f8c8d;
}

/* Countdown Timer */
.countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.countdown-item {
    backdrop-filter: blur(10px);
    padding: 15px;
    min-width: 80px;
    text-align: center;
    border-radius: 12px;
}

.countdown-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
    color: white;
}

.countdown-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
}

/* Search Result Header */
.search-result-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.search-result-header h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.search-result-header h2 i {
    color: #ff6b35;
    margin-right: 10px;
}

.search-result-header .result-stats {
    color: #7f8c8d;
    font-size: 14px;
}

.search-highlight {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

/* Clear search button */
.clear-search {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 13px;
    margin-left: 15px;
    transition: all 0.2s;
}

.clear-search:hover {
    background: #c0392b;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.no-results i {
    font-size: 64px;
    color: #ff6b35;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.no-results p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.suggested-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.suggested-link {
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 25px;
    text-decoration: none;
    color: #ff6b35;
    font-size: 14px;
    transition: all 0.2s;
}

.suggested-link:hover {
    background: #ff6b35;
    color: white;
}

/* Main Container */
.main-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e67e22;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

/* Upload Time Badge */
.upload-time {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
}

.upload-time i {
    color: #f39c12;
    font-size: 10px;
}

/* Product Image */
.product-img-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.product-img {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-img:hover img {
    transform: scale(1.05);
}

.product-img .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 24px;
}

.product-img:hover .image-overlay {
    opacity: 1;
}

/* Product Info */
.product-info {
    padding: 15px;
}

.product-category {
    color: #7f8c8d;
    font-size: 11px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name-link {
    text-decoration: none;
}

.product-name {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    font-weight: 500;
    transition: color 0.3s ease;
}

.product-name-link:hover .product-name {
    color: #f39c12;
}

/* Product Pricing */
.product-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.product-price {
    color: #f39c12;
    font-weight: bold;
    font-size: 16px;
}

.product-compare {
    color: #95a5a6;
    font-size: 12px;
    text-decoration: line-through;
}

.product-discount {
    color: #27ae60;
    font-size: 11px;
    font-weight: 600;
    background: #e8f8f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Product Actions - FIXED FOR MOBILE */
.product-actions {
    display: flex;
    gap: 8px;
}

/* Desktop: hidden until hover */
@media (min-width: 769px) {
    .product-actions {
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .product-card:hover .product-actions {
        opacity: 1;
    }
}

.action-btn {
    flex: 1;
    padding: 8px 4px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
    border: none;
    cursor: pointer;
    background: transparent;
    font-family: inherit;
    border-radius: 4px;
}

.btn-primary {
    background: #f39c12;
    color: white;
}

.btn-primary:hover {
    background: #e67e22;
}

.btn-outline {
    background: transparent;
    color: #f39c12;
    border: 1px solid #f39c12;
}

.btn-outline:hover {
    background: #f39c12;
    color: white;
}

/* Button loading state */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 64px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 20px;
}

.empty-state p {
    color: #95a5a6;
    margin-bottom: 30px;
}

/* ============================================
   TOAST NOTIFICATION - FULLY FIXED FOR MOBILE
   ============================================ */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-notification.error {
    background: #e74c3c;
}

.toast-notification.warning {
    background: #f39c12;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN - FULLY FIXED
   ============================================ */

/* Large Devices (1200px and below) */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Medium Devices (1000px and below) */
@media (max-width: 1000px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet & Small Devices (768px and below) */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 12px 0;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        padding: 40px 20px;
        margin-bottom: 30px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .search-wrapper {
        flex-direction: column;
        border-radius: 20px;
    }
    
    .search-icon {
        padding: 12px 20px 0;
    }
    
    .search-input {
        padding: 12px 20px;
    }
    
    .search-btn {
        padding: 12px 20px;
        border-radius: 0 0 20px 20px;
    }
    
    .countdown {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .countdown-item {
        min-width: 60px;
        padding: 10px;
    }
    
    .countdown-value {
        font-size: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .product-img {
        height: 150px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 12px;
        height: 32px;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    /* PRODUCT ACTIONS - ALWAYS VISIBLE ON MOBILE */
    .product-actions {
        opacity: 1 !important;
    }
    
    .action-btn {
        padding: 8px 6px;
        font-size: 11px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-result-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .clear-search {
        margin-left: 0;
        justify-content: center;
    }
    
    .main-container {
        padding: 0 16px;
    }
    
    /* TOAST NOTIFICATION FIX FOR MOBILE */
    .toast-notification {
        position: fixed;
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: auto;
        width: auto;
        max-width: none;
        animation: slideInDown 0.3s ease;
        border-radius: 8px;
    }
}

/* Small Devices (550px and below) */
@media (max-width: 550px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .main-container {
        padding: 0 12px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .product-img {
        height: 120px;
    }
    
    .action-btn {
        padding: 6px 4px;
        font-size: 10px;
        min-height: 32px;
    }
    
    .product-price {
        font-size: 12px;
    }
    
    .product-discount {
        font-size: 9px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-name {
        font-size: 11px;
        height: 28px;
    }
    
    .toast-notification {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* Extra Small Devices (360px and below) */
@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-img {
        height: 180px;
    }
    
    .product-actions {
        opacity: 1 !important;
    }
}

/* Landscape mode fix for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 25px 20px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .product-img {
        height: 130px;
    }
    
    .toast-notification {
        top: 8px;
        left: 8px;
        right: 8px;
    }
}

/* Touch device optimizations (no hover, always visible) */
@media (hover: none) and (pointer: coarse) {
    .product-actions {
        opacity: 1 !important;
    }
    
    .action-btn,
    .search-btn,
    .clear-search,
    .suggested-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .action-btn:active {
        transform: scale(0.95);
        background: #f39c12;
        color: white;
    }
    
    .btn-primary:active {
        background: #e67e22;
    }
    
    .btn-outline:active {
        background: #f39c12;
        color: white;
    }
}

/* Prevent any element from causing horizontal scroll */
@media (max-width: 768px) {
    .products-grid,
    .main-container,
    .hero,
    .header,
    .search-container,
    [class*="grid"],
    [class*="container"] {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure all images are responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix any potential overflow from flex/grid children */
    .product-card,
    .category-card {
        min-width: 0;
        width: 100%;
    }
    
    /* Prevent text overflow */
    .product-name,
    .product-category,
    .nav-link {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}