:root {
    --primary: #ff8000;
    --primary-dark: #e66a00;
    --bg-dark: #1a1a1a;
    --bg-secondary: #252525;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --border: #333;
    --container-width: 1200px;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Onest', sans-serif;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    padding-bottom: env(safe-area-inset-bottom);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
.navbar {
    background: var(--bg-dark);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.brand-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.header-phone {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
}

.header-phone:hover {
    color: var(--primary);
}

/* Grid System */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Product Card */
.product-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-image .product-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 40px 16px 14px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    z-index: 2;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    min-height: 44px;
    line-height: 1.2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #000;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #000;
}

/* Banner Slider */
.banner-slider {
    position: relative;
    width: 100%;
    height: 100px;
    margin: 40px 0;
    border-radius: 16px;
    overflow: hidden;
}

.banner-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.banner-slide {
    flex: 0 0 50%;
    min-width: 50%;
    height: 100%;
    padding: 0 4px;
    box-sizing: border-box;
}

.banner-slide:first-child {
    padding-left: 0;
}

.banner-slide:last-child {
    padding-right: 0;
}

.banner-slide a,
.banner-slide img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    object-fit: cover;
}

.banner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.banner-arrow {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    pointer-events: auto;
    transition: var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.banner-arrow:hover {
    background: var(--primary);
    color: #000;
}

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

.banner-dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.banner-dot.active {
    background: var(--primary);
    width: 30px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .banner-slider { height: 75px; }
}

/* Product view page */
.view-container {
    margin-top: 40px;
}

.view-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 50px;
}

.main-image-wrapper {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 30px;
    position: relative;
    touch-action: pan-y;
}

.main-image-wrapper img {
    width: 100%;
    max-height: 700px;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-arrow:hover { background: var(--primary); color: #000; }
.nav-arrow.prev { left: 20px; }
.nav-arrow.next { right: 20px; }

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

.gallery-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
}

.gallery-item:hover { border-color: var(--primary); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

.product-details h1 {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--primary);
}

.product-details .price {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    display: block;
}

.product-details .description {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    transition: var(--transition);
    min-height: 44px;
}

.back-link:hover { color: var(--primary); }

.order-btn {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    margin: 60px 0 20px;
    text-transform: uppercase;
}

.section-title span {
    color: var(--primary);
}

.section-subtitle {
    text-align: center;
    margin-bottom: 20px;
}

.section-subtitle a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.section-subtitle a:hover {
    color: var(--primary);
}

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
}

.group-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 8px;
}

.group-filter-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    border: 2px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.group-filter-btn:hover,
.group-filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 128, 0, 0.1);
}

.product-group {
    display: inline-block;
    font-size: 12px;
    color: var(--primary);
    background: rgba(255, 128, 0, 0.15);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.countertop-card .product-footer {
    justify-content: flex-end;
}

.countertop-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.countertop-link:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.countertop-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 20px;
}

.countertop-pan-frame {
    position: relative;
    width: 100%;
    height: 320px;
    border: 2px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    background: #0d0d0d;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.countertop-pan-frame.dragging {
    cursor: grabbing;
}

.countertop-pan-inner {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

.countertop-pan-inner img {
    display: block;
    max-width: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.countertop-pan-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
}

.countertop-details h1 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--primary);
}

.countertop-details .description {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .countertop-pan-frame {
        height: 220px;
    }

    .countertop-pan-hint {
        font-size: 11px;
        padding: 5px 10px;
    }

    .countertop-details h1 {
        font-size: 24px;
    }
}

@media (hover: hover) {
    .countertop-link:hover {
        transform: translateY(-10px);
        border-color: var(--primary);
        box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    }
}

@media (hover: none) {
    .countertop-link:hover {
        transform: none;
    }
}

.blum-card .product-footer {
    justify-content: space-between;
}

.countertop-image img {
    pointer-events: none;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0 60px;
}

.news-card {
    display: flex;
    gap: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.news-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.news-card-image {
    flex-shrink: 0;
    width: 220px;
    min-height: 140px;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-date {
    display: block;
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.news-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #fff;
}

.news-excerpt {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.news-article {
    max-width: 900px;
    margin: 0 auto;
}

.news-article-header {
    margin-bottom: 30px;
}

.news-article-header h1 {
    font-size: 36px;
    font-weight: 900;
    color: var(--primary);
    margin: 8px 0 0;
}

.news-gallery {
    margin-bottom: 30px;
}

.news-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-muted);
}

footer {
    background: #111;
    padding: 80px 0 40px;
    margin-top: 80px;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.footer-about h4 {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 15px;
}

.footer-about p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    max-width: 400px;
}

.footer-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.footer-links a:hover,
.footer-links a.active {
    color: var(--primary);
    padding-left: 5px;
}

.footer-contacts {
    list-style: none;
}

.footer-contacts li {
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contacts a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-contacts a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-about {
        grid-column: 1 / -1;
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .navbar {
        padding: 12px 0;
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    .navbar .container {
        gap: 12px;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-desc {
        font-size: 11px;
        line-height: 1.3;
    }

    .header-phone {
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .banner-slider {
        height: 75px;
        margin: 20px 0;
        border-radius: 12px;
    }

    .banner-slide a,
    .banner-slide img {
        border-radius: 10px;
    }

    .banner-arrow {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .banner-dots {
        bottom: 4px;
        gap: 5px;
    }

    .banner-dot {
        width: 8px;
        height: 8px;
    }

    .banner-dot.active {
        width: 22px;
    }

    .section-title {
        font-size: 24px;
        margin: 32px 0 16px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 24px;
    }

    .product-image {
        height: 220px;
    }

    .product-image .product-title {
        font-size: 16px;
        padding: 32px 14px 12px;
    }

    .product-info {
        padding: 16px;
    }

    .product-desc {
        font-size: 13px;
        margin-bottom: 16px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-footer {
        flex-wrap: wrap;
        gap: 12px;
    }

    .price {
        font-size: 18px;
    }

    .btn-outline {
        padding: 10px 16px;
        font-size: 14px;
    }

    .news-card {
        flex-direction: column;
    }

    .news-card-image {
        width: 100%;
        min-height: 180px;
    }

    .news-card-body {
        padding: 20px;
    }

    .news-article-header h1 {
        font-size: 26px;
    }

    footer {
        padding: 48px 0 32px;
        margin-top: 48px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 32px;
    }

    .footer-about h4 {
        font-size: 20px;
    }

    .footer-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .footer-bottom {
        padding-top: 24px;
        font-size: 12px;
    }

    /* Product view */
    .view-container {
        margin-top: 20px;
        padding-bottom: 80px;
    }

    .view-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .main-image-wrapper {
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .main-image-wrapper img {
        max-height: 320px;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .nav-arrow.prev { left: 10px; }
    .nav-arrow.next { right: 10px; }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 10px;
    }

    .product-details h1 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .product-details .price {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .product-details .description {
        font-size: 15px;
        line-height: 1.7;
    }

    .order-btn {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        z-index: 1000;
        padding: 16px 20px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }
}

@media (max-width: 380px) {
    .navbar .container {
        flex-wrap: wrap;
    }

    .header-phone {
        width: 100%;
        text-align: right;
        font-size: 15px;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-footer .btn {
        text-align: center;
    }
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-10px);
        border-color: var(--primary);
        box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    }

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

@media (hover: none) {
    .product-card:hover .product-image img {
        transform: none;
    }
}
