/*
Theme Name: VitoluxUA
Theme URI: https://vitoluxua.com
Author: VitoluxUA
Description: Custom e-commerce theme for VitoluxUA - generators, welding equipment, heat pumps and more. Bilingual UA/EN with WooCommerce integration.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: vitoluxua
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* === CSS Variables === */
:root {
    --color-primary: #1a56db;
    --color-primary-dark: #1443b0;
    --color-primary-light: #3b82f6;
    --color-accent: #f97316;
    --color-accent-dark: #ea580c;
    --color-accent-light: #fb923c;
    --color-bg: #f8fafc;
    --color-bg-white: #ffffff;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-muted: #94a3b8;
    --color-border: #e2e8f0;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1280px;
    --header-height: 140px;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* === Top Bar === */
.top-bar {
    background: var(--color-primary);
    color: #fff;
    padding: 8px 0;
    font-size: 0.875rem;
}

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

.top-bar a {
    color: #fff;
    opacity: 0.9;
}

.top-bar a:hover {
    opacity: 1;
}

.top-bar__contact {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-bar__contact svg {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.top-bar__lang {
    display: flex;
    gap: 8px;
    align-items: center;
}

.top-bar__lang a {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.top-bar__lang a.active {
    background: rgba(255,255,255,0.2);
}

/* === Header === */
.site-header {
    background: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-main {
    padding: 12px 0;
}

.header-main .container {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo {
    flex-shrink: 0;
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
}

.site-logo .logo-accent {
    color: var(--color-accent);
}

.header-search {
    flex: 1;
    max-width: 500px;
}

.header-search form {
    display: flex;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}

.header-search form:focus-within {
    border-color: var(--color-primary);
}

.header-search input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: inherit;
}

.header-search button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.header-search button:hover {
    background: var(--color-primary-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-cart {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}

.header-cart:hover {
    background: var(--color-accent-dark);
    color: #fff;
}

.header-cart__count {
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -6px;
    right: -6px;
}

/* === Navigation === */
.main-nav {
    background: var(--color-primary-dark);
}

.main-nav .container {
    display: flex;
    align-items: stretch;
}

.main-nav__menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.main-nav__menu > li {
    position: relative;
}

.main-nav__menu > li > a {
    display: block;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s;
}

.main-nav__menu > li:hover > a,
.main-nav__menu > li.current-menu-item > a {
    background: rgba(255,255,255,0.1);
}

/* Dropdown */
.main-nav__menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--color-bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 200;
    list-style: none;
}

.main-nav__menu > li:hover > .sub-menu {
    display: block;
}

.sub-menu li a {
    display: block;
    padding: 10px 16px;
    color: var(--color-text);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s, color 0.2s;
}

.sub-menu li:last-child a {
    border-bottom: none;
}

.sub-menu li a:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    padding: 60px 0;
    margin-bottom: 40px;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero__content {
    flex: 1;
}

.hero__title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero__subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 24px;
    line-height: 1.5;
}

.hero__btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s;
}

.hero__btn:hover {
    background: var(--color-accent-dark);
    color: #fff;
    transform: translateY(-2px);
}

.hero__image {
    flex: 1;
    text-align: right;
}

.hero__image img {
    max-width: 500px;
    margin-left: auto;
}

/* === Section Titles === */
.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.section-title p {
    color: var(--color-text-light);
    font-size: 1rem;
}

/* === Categories Grid === */
.categories-section {
    padding: 40px 0;
}

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

.category-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.category-card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: 50%;
}

.category-card__icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.category-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

.category-card__count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* === Product Cards === */
.products-section {
    padding: 40px 0;
}

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

.product-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.product-card__image {
    position: relative;
    padding: 16px;
    background: var(--color-bg);
    text-align: center;
}

.product-card__image img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin: 0 auto;
}

.product-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-card__body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__category {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__title a {
    color: inherit;
}

.product-card__title a:hover {
    color: var(--color-primary);
}

.product-card__prices {
    margin-top: auto;
    margin-bottom: 12px;
}

.product-card__price-uah {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.product-card__price-eur {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.product-card__actions {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    flex: 1;
}

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

.btn-accent {
    background: var(--color-accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--color-accent-dark);
    color: #fff;
}

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

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* === Quick Order Messengers === */
.messenger-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.messenger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    transition: opacity 0.2s, transform 0.2s;
}

.messenger-btn:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

.messenger-btn--telegram {
    background: #0088cc;
}

.messenger-btn--viber {
    background: #665CAC;
}

.messenger-btn--whatsapp {
    background: #25D366;
}

.messenger-btn svg {
    width: 18px;
    height: 18px;
}

/* === Floating Messengers === */
.floating-messengers {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-messengers a {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-messengers a:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.floating-messengers a svg {
    width: 28px;
    height: 28px;
}

.floating-messengers .fm-telegram {
    background: #0088cc;
}

.floating-messengers .fm-viber {
    background: #665CAC;
}

.floating-messengers .fm-whatsapp {
    background: #25D366;
}

/* === Single Product === */
.single-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px 0;
}

.product-gallery {
    position: sticky;
    top: 160px;
    align-self: start;
}

.product-gallery__main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-white);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.product-gallery__main img {
    width: 100%;
    height: 400px;
    object-fit: contain;
}

.product-gallery__thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.product-gallery__thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    padding: 4px;
    background: var(--color-bg-white);
    transition: border-color 0.2s;
}

.product-gallery__thumb.active,
.product-gallery__thumb:hover {
    border-color: var(--color-primary);
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-info__sku {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.product-info__availability {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.product-info__availability--instock {
    background: #dcfce7;
    color: var(--color-success);
}

.product-info__availability--outofstock {
    background: #fee2e2;
    color: var(--color-danger);
}

.product-info__prices {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius);
}

.product-info__price-uah {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
}

.product-info__price-eur {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

.product-info__description {
    margin-bottom: 24px;
    line-height: 1.7;
    color: var(--color-text);
}

.product-info__specs {
    margin-bottom: 24px;
}

.product-info__specs table {
    width: 100%;
    border-collapse: collapse;
}

.product-info__specs td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.product-info__specs td:first-child {
    font-weight: 600;
    color: var(--color-text);
    width: 40%;
    background: var(--color-bg);
}

.product-info__add-to-cart {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.product-info__qty {
    display: flex;
    align-items: center;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.product-info__qty button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--color-bg);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background 0.2s;
}

.product-info__qty button:hover {
    background: var(--color-border);
}

.product-info__qty input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    outline: none;
}

/* === Sidebar === */
.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding: 30px 0;
}

.shop-sidebar {
    align-self: start;
    position: sticky;
    top: 160px;
}

.widget {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.widget__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
}

.widget__categories {
    list-style: none;
}

.widget__categories li {
    margin-bottom: 2px;
}

.widget__categories li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--color-text);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.widget__categories li a:hover,
.widget__categories li.current a {
    background: var(--color-bg);
    color: var(--color-primary);
}

.widget__categories li a span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.widget__categories .sub-cats {
    list-style: none;
    padding-left: 16px;
}

/* === Breadcrumbs === */
.breadcrumbs {
    padding: 16px 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.breadcrumbs a {
    color: var(--color-text-light);
}

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

.breadcrumbs .sep {
    margin: 0 8px;
}

/* === Footer === */
.site-footer {
    background: var(--color-primary-dark);
    color: #fff;
    padding: 48px 0 0;
    margin-top: 60px;
}

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

.footer-col__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 12px;
}

.footer-col__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
}

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

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--color-accent);
}

.footer-col p {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

/* === WooCommerce Overrides === */
.woocommerce-message,
.woocommerce-info {
    border-top-color: var(--color-primary) !important;
}

.woocommerce-message::before,
.woocommerce-info::before {
    color: var(--color-primary) !important;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background-color: var(--color-primary) !important;
    color: #fff !important;
    border-radius: var(--radius) !important;
    font-weight: 600 !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background-color: var(--color-primary-dark) !important;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    background-color: var(--color-accent) !important;
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
    background-color: var(--color-accent-dark) !important;
}

.woocommerce .price {
    color: var(--color-primary) !important;
    font-weight: 700;
}

.woocommerce span.onsale {
    background-color: var(--color-accent) !important;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: static;
    }

    .single-product-layout {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        position: static;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero__image {
        text-align: center;
    }

    .hero__image img {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: auto;
    }

    .top-bar .container {
        flex-direction: column;
        gap: 8px;
    }

    .header-main .container {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .main-nav__menu {
        flex-direction: column;
    }

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

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero__title {
        font-size: 1.75rem;
    }

    .floating-messengers {
        bottom: 16px;
        right: 16px;
    }

    .floating-messengers a {
        width: 48px;
        height: 48px;
    }
}

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

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .product-card__actions {
        flex-direction: column;
    }

    .messenger-buttons {
        flex-direction: column;
    }
}
