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

body {
    font-family: Arial, sans-serif;
    background: #f8f9fa;
    color: #2d3748;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ====== ВЕРХНЯ СМУГА (МІНІМАЛЬНА) ====== */
.top-info-bar {
    background: #1a202c;
    color: #cbd5e0;
    font-size: 9px;
    padding: 2px 0;
}
.top-info-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3px;
}
.top-info-content i {
    color: #667eea;
    margin-right: 3px;
}

/* ====== ШАПКА (КОМПАКТНА) ====== */
.main-header {
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    padding: 4px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.logo-box {
    display: flex;
    align-items: center;
    gap: 4px;
}
.circle-nav-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 11px;
}
.logo-shop {
    font-size: 15px;
    font-weight: 800;
    color: #764ba2;
    display: flex;
    align-items: center;
    gap: 3px;
}
.logo-shop .highlight {
    color: #667eea;
}
.logo-shop .icon {
    font-size: 13px;
}
.header-search {
    flex: 1;
    min-width: 120px;
    position: relative;
}
.header-search .search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 10px;
}
.header-search input {
    width: 100%;
    padding: 4px 8px 4px 24px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 10px;
    outline: none;
}
.header-search input:focus {
    border-color: #764ba2;
}
.messenger-buttons {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 6px;
    border-radius: 10px;
    color: white;
    font-size: 8px;
    font-weight: 600;
    text-decoration: none;
}
.social-btn.viber { background: #7360f2; }
.social-btn.whatsapp { background: #25d366; }
.social-btn.telegram { background: #0088cc; }
.social-btn.instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.social-btn.tiktok { background: #000000; }
.social-btn.youtube { background: #ff0000; }

.cart-btn-box {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
}
.cart-btn-box i {
    color: #764ba2;
    font-size: 12px;
}
.cart-label {
    font-size: 9px;
    font-weight: 600;
    color: #2d3748;
}
.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
}

/* ====== НАВІГАЦІЯ (МІНІМАЛЬНА) ====== */
.sub-nav {
    background: #2d3748;
    color: #e2e8f0;
    padding: 2px 0;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
}
.nav-links {
    display: flex;
    gap: 6px;
}
.nav-item {
    background: none;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-item:hover {
    color: white;
}
.nav-delivery-info {
    font-size: 8px;
    color: #cbd5e0;
}
.nav-delivery-info i {
    color: #27ae60;
}

/* ====== БАНЕРИ (МІНІМАЛЬНІ) ====== */
.banners-container {
    margin: 3px 0 5px 0;
}
.banner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.banner-item {
    border-radius: 4px;
    padding: 4px 8px;
    color: white;
    cursor: pointer;
}
.banner-content h3 {
    font-size: 8px;
    margin-bottom: 0;
}
.banner-content p {
    font-size: 6px;
    opacity: 0.9;
    margin-bottom: 2px;
}
.banner-content button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 1px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 6px;
}

/* ====== КАТЕГОРІЇ (КОМПАКТНІ) ====== */
.marketplace-categories {
    margin-bottom: 8px;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 4px;
}
.category-item {
    background: white;
    border-radius: 6px;
    padding: 4px 2px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}
.category-item:hover {
    border-color: #764ba2;
}
.category-item i {
    font-size: 12px;
    color: #764ba2;
    display: block;
    margin-bottom: 1px;
}
.category-item span {
    font-size: 7px;
    font-weight: 600;
    color: #2d3748;
}

/* ====== СЛАЙДЕР (МІНІМАЛЬНИЙ) ====== */
.slider-container {
    position: relative;
    max-width: 100%;
    margin: 3px 0 6px 0;
    padding: 3px 0;
    overflow: hidden;
    background: transparent;
}
.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 4px;
    padding: 3px 2px;
}
.slide-item {
    min-width: 90px;
    flex: 0 0 auto;
}
.slide-product-card {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #edf2f7;
    cursor: pointer;
}
.slide-img-wrapper {
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 3px;
}
.slide-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.slide-product-info {
    padding: 3px 4px;
}
.slide-product-title {
    font-size: 7px;
    font-weight: 600;
    height: 14px;
    overflow: hidden;
    color: #2d3748;
}
.slide-price-box {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin: 1px 0 2px 0;
}
.slide-product-price {
    font-size: 8px;
    font-weight: 700;
    color: #e74c3c;
}
.slide-old-price {
    font-size: 6px;
    color: #999;
    text-decoration: line-through;
}
.slide-add-cart {
    width: 100%;
    padding: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 6px;
    font-weight: 600;
    cursor: pointer;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.15);
    color: white;
    border: none;
    padding: 3px 5px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 7px;
    z-index: 10;
}
.slider-btn:hover {
    background: rgba(0,0,0,0.3);
}
.slider-btn.prev { left: 2px; }
.slider-btn.next { right: 2px; }

/* ====== КАТАЛОГ ====== */
.main-content {
    margin-bottom: 15px;
}
.catalog-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 4px;
}
.catalog-top-bar h2 {
    font-size: 12px;
}
.sort-box select {
    padding: 3px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 9px;
    cursor: pointer;
}
.categories-scroll {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.category-btn {
    background: white;
    border: 1.5px solid #e2e8f0;
    padding: 3px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    color: #4a5568;
}
.category-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #764ba2;
}
.category-btn:first-child {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #764ba2;
}

/* ====== ТОВАРИ ====== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}
.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #edf2f7;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    animation: fadeIn 0.4s ease-in-out;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.product-img-wrapper {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 6px;
}
.product-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}
.product-card:hover .product-img {
    transform: scale(1.04);
}
.product-info {
    padding: 8px;
}
.product-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    height: 32px;
    overflow: hidden;
    line-height: 1.3;
}
.price-box {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: 3px 0 5px 0;
}
.product-price {
    font-size: 15px;
    font-weight: 700;
    color: #e74c3c;
}
.old-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
}
.add-cart-btn {
    width: 100%;
    padding: 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.add-cart-btn:hover {
    opacity: 0.9;
}
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #999;
}

/* ====== ФІЛЬТРИ ====== */
.filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.filter-group label {
    font-weight: 600;
    font-size: 10px;
}
.filter-group input[type="range"] {
    width: 80px;
    accent-color: #764ba2;
}
.rating-filter span {
    cursor: pointer;
    font-size: 10px;
}
.filter-reset {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 9px;
}

/* ====== МОДАЛЬНІ ВІКНА ====== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: white;
    width: 92%;
    max-width: 480px;
    padding: 14px;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.close-modal {
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 18px;
    cursor: pointer;
    color: #999;
}
.product-detail-content {
    max-width: 650px !important;
}
.product-detail-body {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.product-detail-img-box {
    flex: 1;
    min-width: 160px;
    text-align: center;
}
.product-detail-img-box img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}
.product-detail-thumbnails {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    justify-content: center;
    flex-wrap: wrap;
}
.thumb-img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}
.thumb-img.active {
    border-color: #764ba2;
}
.product-detail-info {
    flex: 1;
    min-width: 160px;
}
.stock-badge {
    background: #e6fffa;
    color: #27ae60;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    display: inline-block;
}
.detail-price {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
    margin: 4px 0;
}
.detail-desc {
    font-size: 12px;
    color: #555;
    margin: 4px 0;
}
.order-info-box {
    background: #f7fafc;
    padding: 6px;
    border-radius: 4px;
    font-size: 11px;
    margin: 4px 0;
}
.btn-submit {
    width: 100%;
    padding: 8px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* ====== ВІДГУКИ ====== */
.reviews-section {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}
.reviews-header {
    text-align: center;
    margin-bottom: 10px;
}
.reviews-header h2 {
    font-size: 14px;
}
.reviews-header p {
    font-size: 11px;
    color: #718096;
}
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}
.review-card {
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #edf2f7;
}
.review-stars {
    font-size: 11px;
}
.review-text {
    font-size: 11px;
    font-style: italic;
    margin-bottom: 4px;
    color: #555;
}
.review-author {
    font-size: 10px;
    font-weight: 600;
    text-align: right;
}

/* ====== ФУТЕР ====== */
footer {
    background: #1a202c;
    color: #a0aec0;
    padding: 15px 0 6px;
    margin-top: 15px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    padding-bottom: 10px;
}
.footer-col h3,
.footer-col h4 {
    color: white;
    font-size: 11px;
    margin-bottom: 4px;
}
.footer-col p {
    font-size: 9px;
    line-height: 1.3;
    margin-bottom: 2px;
}
.footer-col ul li {
    font-size: 9px;
    margin-bottom: 2px;
    cursor: pointer;
}
.footer-col ul li:hover {
    color: #764ba2;
}
.footer-bottom {
    border-top: 1px solid #2d3748;
    padding: 6px 0;
    text-align: center;
    font-size: 8px;
}

/* ====== ПЛАВАЮЧІ КНОПКИ ====== */
.theme-toggle {
    position: fixed;
    top: 44px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    font-size: 9px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
#scrollTopBtn {
    position: fixed;
    bottom: 60px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    font-size: 10px;
    cursor: pointer;
    z-index: 999;
    display: none;
}
.chat-btn {
    position: fixed;
    bottom: 12px;
    right: 4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0088cc;
    color: white;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ====== ТЕМНА ТЕМА ====== */
body.dark-mode {
    background: #1a1a2e;
    color: #e2e8f0;
}
body.dark-mode .main-header { background: #16213e; }
body.dark-mode .product-card { background: #16213e; border-color: #2d3748; }
body.dark-mode .product-title { color: #e2e8f0; }
body.dark-mode .category-btn { background: #16213e; color: #e2e8f0; border-color: #2d3748; }
body.dark-mode .category-btn.active { background: #764ba2; color: white; }
body.dark-mode .category-btn:first-child { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
body.dark-mode .modal-content { background: #1a1a2e; color: #e2e8f0; }
body.dark-mode .review-card { background: #16213e; }
body.dark-mode .review-text { color: #cbd5e0; }
body.dark-mode .cart-btn-box { background: #16213e; }
body.dark-mode .order-info-box { background: #16213e; }
body.dark-mode .detail-desc { color: #cbd5e0; }
body.dark-mode .category-item { background: #16213e; border-color: #2d3748; }
body.dark-mode .category-item span { color: #e2e8f0; }
body.dark-mode .category-item i { color: #a78bfa; }
body.dark-mode .slide-product-card { background: #16213e; border-color: #2d3748; }
body.dark-mode .slide-product-title { color: #e2e8f0; }
body.dark-mode .filter-container { background: #16213e; border-color: #2d3748; }

/* ====== АНІМАЦІЇ ====== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== АДАПТАЦІЯ ДЛЯ ТЕЛЕФОНІВ ====== */
@media (max-width: 600px) {
    .banner-grid { grid-template-columns: 1fr 1fr 1fr; gap: 3px; }
    .banner-item { padding: 3px 5px; }
    .banner-content h3 { font-size: 7px; }
    .banner-content p { font-size: 5px; }
    .banner-content button { font-size: 5px; padding: 1px 4px; }

    .category-grid { grid-template-columns: repeat(4, 1fr); gap: 3px; }
    .category-item { padding: 3px 2px; }
    .category-item i { font-size: 10px; }
    .category-item span { font-size: 6px; }

    .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
    .product-img-wrapper { height: 130px; }
    .product-title { font-size: 11px; height: 28px; }
    .product-price { font-size: 13px; }

    .slide-item { min-width: 70px; }
    .slide-img-wrapper { height: 45px; }
    .slide-product-title { font-size: 6px; height: 12px; }
    .slide-product-price { font-size: 7px; }
    .slide-add-cart { font-size: 5px; padding: 1px; }
    .slider-btn { padding: 2px 4px; font-size: 6px; }

    .header-search { min-width: 80px; }
    .header-search input { font-size: 9px; padding: 3px 6px 3px 20px; }
    .logo-shop { font-size: 13px; }
    .social-btn { font-size: 7px; padding: 2px 4px; }
    .cart-btn-box { padding: 2px 6px; }
    .cart-label { font-size: 8px; }
    .filter-container { flex-direction: column; align-items: stretch; gap: 4px; }
    .filter-group input[type="range"] { width: 100%; }
}

/* ====== ДУЖЕ МАЛІ ТЕЛЕФОНИ (до 400px) ====== */
@media (max-width: 400px) {
    .banner-grid { grid-template-columns: 1fr 1fr; }
    .products-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .product-img-wrapper { height: 100px; }
    .product-title { font-size: 10px; height: 24px; }
    .product-price { font-size: 12px; }
    .add-cart-btn { font-size: 9px; padding: 4px; }
    .slide-item { min-width: 60px; }
    .slide-img-wrapper { height: 38px; }
}
