:root {
    --space-deep: #0B0B2A;
    --space-purple: #2D1B4E;
    --space-accent: #7B2EDA;
    --copper-star: #FFB347;
    --white: #FFFFFF;
    --gray-light: #F8F9FC;
    --gray-border: #E9ECF3;
}

*, :hover, :active, :focus { outline: none; }

body {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, 'Roboto', sans-serif;
    background: var(--white);
    color: #1A1A2A;
}

h1, h2, h3, h4, h5, legend {
    font-weight: 700;
    background: linear-gradient(135deg, var(--space-deep) 0%, var(--space-purple) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    letter-spacing: -0.02em;
}
h1 { margin-bottom: 20px; font-size: 2.5rem; }

a {
    color: var(--space-purple);
    transition: all 0.25s ease;
    font-weight: 500;
}
a:hover, a:focus { color: var(--space-accent); text-decoration: none; }

.title {
    padding: 16px 32px;
    border: 2px solid transparent;
    color: var(--space-deep);
    text-align: center;
    margin: 20px auto;
    width: fit-content;
    background: rgba(123, 46, 218, 0.05);
    border-radius: 60px;
    backdrop-filter: blur(2px);
    font-weight: 600;
}

.icon {
    font-size: 28px;
    color: var(--space-purple);
    transition: transform 0.2s;
}
.icon:hover { transform: scale(1.1); color: var(--space-accent); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #E9ECF3; border-radius: 10px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--space-purple), var(--space-accent));
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--copper-star); }

.form-control {
    height: 48px;
    margin-bottom: 20px;
    border-radius: 16px;
    border: 1.5px solid var(--gray-border);
    background: var(--white);
    padding: 12px 20px;
    transition: all 0.2s;
    font-size: 15px;
}
.form-control:focus {
    border-color: var(--space-accent);
    box-shadow: 0 0 0 4px rgba(123, 46, 218, 0.15);
}
.form-control::placeholder { color: #A0A5B5; }

.table { border-radius: 10px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.table > thead > tr > th {
    background: var(--space-deep);
    color: white;
    font-weight: 600;
    border: none;
}
.table,
.table > thead > tr > th,
.table > tbody > tr > td {
    border-color: var(--gray-border);
    padding: 16px 24px;
    vertical-align: middle;
}

header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(123, 46, 218, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}
.flex { display: flex; width: 100%; justify-content: space-between; align-items: center; }

.hidden-menu {
    background: linear-gradient(145deg, #FFFFFF, #F5F3FF);
    border-right: 1px solid var(--space-accent);
    box-shadow: 8px 0 30px rgba(0,0,0,0.05);
}
.btn-menu span { background: linear-gradient(90deg, var(--space-deep), var(--space-accent)); }
.hidden-menu a {
    font-weight: 600;
    color: var(--space-deep);
    border-radius: 40px;
    margin: 6px 12px;
}
.hidden-menu a:hover {
    background: rgba(123, 46, 218, 0.1);
    transform: translateX(8px);
    color: var(--space-accent);
}

#cart-itemscount {
    background: linear-gradient(135deg, var(--space-accent), var(--copper-star));
    box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.3);
    font-weight: bold;
}
#cart .dropdown-menu {
    border-radius: 24px;
    border: none;
    box-shadow: 0 20px 35px -12px rgba(11, 11, 42, 0.2);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.97);
}

.btn {
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 40px;
    transition: all 0.25s;
    letter-spacing: 0.3px;
}

/* ===== btn-buy (кнопки в категорії та схожих товарах) ===== */
.btn-buy {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    width: auto;
    padding: 8px 10px;
    color: var(--space-purple);
    font-weight: 700;
    gap: 0;
    height: auto;
}
.btn-buy i { font-size: 30px; }
.btn-buy:hover {
    transform: translateY(-3px);
    background: transparent !important;
    box-shadow: none !important;
    color: var(--space-accent);
    filter: drop-shadow(0 0 6px var(--space-accent));
}

.btn-info, .btn-primary, .btn-default {
    background: linear-gradient(90deg, var(--space-deep), var(--space-purple));
    border: none;
    color: white;
}
.btn-info:hover, .btn-primary:hover {
    background: linear-gradient(90deg, var(--space-purple), var(--space-accent));
    transform: scale(1.02);
}

/* ===== Кнопки картки товару: стиль як btn-buy в категорії ===== */
.btn-cart {
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
    color: var(--space-purple);
    font-weight: 700;
    box-shadow: none !important;
    padding: 0;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: all 0.25s;
}
.btn-cart i { font-size: 26px; pointer-events: none; }
.btn-cart:hover, .btn-cart:focus, .btn-cart:active {
    background: transparent !important;
    color: var(--space-accent);
    filter: drop-shadow(0 0 8px var(--space-accent));
    transform: translateY(-3px);
    box-shadow: none !important;
}

.btn-boc {
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
    color: #c8a96e;
    font-weight: 700;
    box-shadow: none !important;
    padding: 0;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: all 0.25s;
}
.btn-boc i { font-size: 26px; pointer-events: none; }
.btn-boc:hover, .btn-boc:focus, .btn-boc:active {
    background: transparent !important;
    color: #b5944f;
    filter: drop-shadow(0 0 8px #c8a96e);
    transform: translateY(-3px);
    box-shadow: none !important;
}

/* ===== Button labels ===== */
.btn-label-icon { display: inline-flex; align-items: center; }
.btn-label-text { display: inline; margin-left: 6px; }

.onepagecheckout .checkout-content p,
.onepagecheckout .checkout-content .radio { padding: 0 !important; }

.input-group { margin-bottom: 5px; }

/* ===== Products grid ===== */
.products-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.product-card {
    width: calc(25% - 3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: white;
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(123, 46, 218, 0.15);
}

.product-card__image { margin-bottom: 16px; }
.product-card__image img { max-width: 100%; }
.product-card__name { min-height: 65px; margin-bottom: 7px; }
.product-card__price { margin-bottom: 12px; margin-top: auto; font-weight: 700; color: #03023b; }
.product-card__buttons { display: flex; gap: 3px; }

.front, .back { background: white; border-radius: 10px; padding: 24px; }
.front h4 {
    background: linear-gradient(135deg, var(--space-deep), var(--space-purple));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.back { background: linear-gradient(145deg, #FFFFFF, #FBF9FF); justify-content: space-evenly; }
.price-new { color: #f60306; font-weight: 700; font-size: 16px; }
.price-old { color: #8E8EA8; }

.pagination > li > a, .pagination > li > span {
    border-radius: 40px !important;
    margin: 0 4px;
    background: white;
    border: 1px solid var(--gray-border);
    color: var(--space-deep);
    font-weight: 500;
}
.pagination > .active > a {
    background: linear-gradient(135deg, var(--space-deep), var(--space-purple));
    border-color: transparent;
    color: white;
}
.pagination { margin-top: 10px; }

footer {
    background: linear-gradient(145deg, #07071C, var(--space-deep));
    color: #CFCFE6;
    border-top: 1px solid rgba(123, 46, 218, 0.3);
    position: relative;
    overflow: hidden;
}
footer::before {
    content: "✦ ✧ ✦ ✧";
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    font-size: 12px;
    letter-spacing: 20px;
    color: rgba(255, 179, 71, 0.2);
    text-align: center;
    pointer-events: none;
}
footer a { color: #B9B9E6; }
footer a:hover { color: var(--copper-star); }

input[type="radio"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--space-accent);
    background: white;
    box-shadow: 0 0 0 2px rgba(123, 46, 218, 0.2);
}
input[type="radio"]:checked {
    background: var(--space-accent);
    border-color: white;
    box-shadow: 0 0 0 3px rgba(123, 46, 218, 0.4);
}
label { font-weight: 500; color: var(--space-deep); }

.category-accordion__toggle {
    background: transparent;
    border: 1px solid var(--space-purple);
    border-radius: 40px;
    padding: 8px 20px;
    color: var(--space-purple);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.category-accordion__toggle:hover { color: var(--space-accent); border-color: var(--space-accent); }
.category-accordion__body { margin-bottom: 16px; }

/* ===== Coffee Stickers ===== */
.product-card__image-wrap { position: relative; display: flex; flex-direction: column; }
.pcs-top { position: absolute; top: 8px; left: 8px; z-index: 10; display: flex; flex-direction: column; gap: 4px; }
.pcs-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.4;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.pcs-badge--sale      { background: #c0392b; color: #fff; }
.pcs-badge--clearance { background: #e67e22; color: #fff; }
.pcs-bottom { padding: 5px 0 2px; width: 100%; box-sizing: border-box; height: 100px; overflow: hidden; }
.pcs-row { display: flex; flex-wrap: wrap; gap: 3px; width: 100%; }
.pcs-row--flavor { margin-top: 3px; }
.pcs-chip {
    display: inline-block;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.35;
    padding: 2px 6px;
    white-space: nowrap;
    cursor: default;
}
.pcs-chip--ca  { background: #fdf3e3; border: 1px solid #e8c98a; color: #7a5c1e; font-weight: 600; }
.pcs-chip--cs  { background: #f0fbe8; border: 1px solid #a8d880; color: #3a6b17; font-weight: 600; }
.pcs-chip--cb  { background: #3b1f0e; border: 1px solid #7a4a2a; color: #f5e6d3; font-weight: 600; }
.pcs-chip--flavor { background: #f7f0e8; border: 1px solid #d9c9b0; color: #5c4a30; border-radius: 20px; font-weight: 500; }
.pcs-chip--flag { background: transparent; border: none; padding: 0 2px; font-size: 18px; line-height: 1; }
.pcs-chip--tag { background: #eef0f5; border: 1px solid #c9cee0; color: #34405c; font-weight: 600; }
.pcs-chip--inactive { filter: grayscale(100%) brightness(.85); opacity: .6; }

/* ===== Manufacturer row ===== */
.product-manufacturer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-manufacturer-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f7f0e8;
    border: 1px solid #c8a96e;
    color: #5c3d1e;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, border-color .2s;
}
.btn-manufacturer-all:hover { background: #ede0cc; border-color: #a07840; color: #3b2208; text-decoration: none; }
.btn-manufacturer-all .icon { font-size: 14px; }

/* ===== Product action row ===== */
.product-action-row { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.product-action-row__qty { flex: 0 0 auto; width: 96px; margin-right: 32px; }
.product-action-row__cart, .product-action-row__boc { flex: 0 0 auto; }
.product-action-row__qty .plus-minus .btn { padding: 4px 7px; font-size: 12px; line-height: 1.4; height: auto; width: 28px; }
.product-action-row__qty .plus-minus .form-control { padding-left: 4px; padding-right: 4px; font-size: 13px; height: auto; }

/* ===== Responsive ===== */
@media (min-width: 1600px) {
    .container { width: 1500px; margin-top: 7px; }
}

@media (max-width: 1024px) {
    .container { margin-top: 5px; }
    .card { width: calc(33% - 5px); }
    .product-card { width: calc(33.333% - 2.67px); }
}

@media (max-width: 767px) {

    .product-main-row {
        display: flex;
        flex-direction: column;
    }
    .product-card {
        width: calc(50% - 2px);
    }

    .product-col-image {
        order: 0 !important;
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    .product-col-image .thumbnails { order: 0; }
    .product-col-image .nav-tabs,
    .product-col-image .tab-content { order: 3; }

    .product-col-info {
        order: 1 !important;
        width: 100%;
        padding-bottom: 0;
    }

    /* Кнопки дії: qty | cart | boc в один рядок */
    .product-action-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        align-items: center;
    }
    .product-action-row__qty {
        flex: 0 0 auto;
        width: 80px;
        margin-right: 32px;
    }
    .product-action-row__qty .plus-minus .btn {
        width: 22px;
        padding: 4px;
    }
    .product-action-row__qty .plus-minus .form-control {
        font-size: 13px;
        padding-left: 2px;
        padding-right: 2px;
    }
    .product-action-row__cart,
    .product-action-row__boc {
        flex: 0 0 auto;
    }

    /* На мобілі — приховати текст, залишити іконку */
    .btn-label-text { display: none; }
    .btn-label-icon { display: inline-flex; }

    /* Tabs — горизонтальний скрол */
    .product-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #ddd;
    }
    .product-tabs > li { flex: 0 0 auto; }
    .product-tabs > li > a { white-space: nowrap; }
    .shopping-bag { margin-top: 11px; }
