/* Categories Section */
/* Categories Section - Icon Cards (Top 4) */
.categories-section {
    padding: 40px 15px;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
    max-width: 100%;
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

.category-card {
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    transition: all 0.3s ease;
    background: var(--card-bg);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin-bottom: 0;
    padding: 0;
    transition: transform 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.category-name {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 8px 20px;
    text-transform: uppercase;
    font-family: 'Playfair Display', serif;
    transition: all 0.3s ease;
    border: 2px solid #d4a017;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(153, 189, 3, 0.3);
    border-color: #aad404;
}

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

.category-card:hover .category-name {
    background: #000000;
    color: #ffffff;
    border-color: #ffd700;
    box-shadow: 0 4px 15px rgba(212, 160, 23, 0.6);
    transform: translateX(-50%) translateY(-2px);
}

/* Mobile optimization for icon categories */
@media (max-width: 768px) {
    .category-name {
        font-size: 0.75rem;
        padding: 7px 18px;
        border: 2px solid #d4a017;
        border-radius: 25px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        gap: 15px;
    }

    .category-card {
        padding: 10px;
    }

    .category-name {
        font-size: 0.7rem;
        padding: 6px 16px;
        border: 2px solid #d4a017;
        border-radius: 25px;
        bottom: 10px;
    }
}

@media (max-width: 360px) {
    .category-name {
        font-size: 0.65rem;
        padding: 5px 14px;
        border: 2px solid #d4a017;
        border-radius: 25px;
    }
}

.category-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    color: #999;
    font-style: italic;
    border-radius: 5px;
}


/* Database Categories Section - Modern Design */
.db-categories-section {
    padding: 30px 15px;
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.5) 0%, rgba(42, 42, 42, 0.3) 100%);
    border-radius: 20px;
    margin: 30px auto;
    text-align: center;
    max-width: 1400px;
}

.db-categories-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    margin-top: 30px;
    max-width: 100%;
}

@media (min-width: 768px) {
    .db-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (min-width: 1100px) {
    .db-categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile specific styles */
@media (max-width: 480px) {
    .db-categories-section {
        padding: 20px 10px;
        margin: 20px 0;
        border-radius: 12px;
    }

    .db-categories-grid {
        gap: 15px;
    }
}

.db-category-card {
    background: linear-gradient(135deg, #252525 0%, #1f1f1f 100%);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 25px 18px;
    min-height: 180px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
}

/* Mobile optimization for db-category-card */
@media (max-width: 480px) {
    .db-category-card {
        padding: 20px 15px;
        min-height: 160px;
        border-radius: 12px;
    }
}

.db-category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(153, 189, 3, 0.1) 0%, transparent 70%);
    transition: all 0.6s ease;
    pointer-events: none;
}

.db-category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(153, 189, 3, 0.05) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.category-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.db-category-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Mobile font size adjustment */
@media (max-width: 480px) {
    .db-category-card h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
}

.db-category-card p {
    color: #c0c0c0;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
}

/* Mobile font size adjustment */
@media (max-width: 480px) {
    .db-category-card p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}

.category-arrow {
    color: var(--primary-color);
    font-size: 1.6rem;
    transition: all 0.3s ease;
    margin-top: auto;
    display: inline-block;
}

@media (max-width: 480px) {
    .category-arrow {
        font-size: 1.4rem;
    }
}

.db-category-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    box-shadow: 0 15px 30px rgba(153, 189, 3, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Less dramatic hover on mobile */
@media (max-width: 480px) {
    .db-category-card:hover {
        transform: translateY(-5px) scale(1.01);
        box-shadow: 0 10px 20px rgba(153, 189, 3, 0.15);
    }
}


.db-category-card:hover::before {
    top: -25%;
    right: -25%;
}

.db-category-card:hover::after {
    opacity: 1;
}

.db-category-card:hover .category-arrow {
    transform: translateX(8px) scale(1.2);
    color: #88a802;
}

/* New Arrivals */
.new-arrivals-section {
    text-align: center;
    padding: 40px 15px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Mobile section title */
@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
}

.title-separator {
    height: 4px;
    width: 60px;
    background-color: var(--primary-color);
    margin: 0 auto;
}

/* Mobile separator */
@media (max-width: 480px) {
    .title-separator {
        height: 3px;
        width: 50px;
    }
}


/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile by default */
    gap: 15px;
    margin-top: 30px;
    max-width: 100%;
    width: 100%;
    overflow-x: visible;
    overflow-y: visible;
}

/* Small phones - 2 column still works generally, maybe adjust gap */
@media (max-width: 360px) {
    .products-grid {
        gap: 10px;
    }
}

/* Tablets - 3 columns */
@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Desktop - 4 columns */
@media (min-width: 1100px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile optimization for products */
@media (max-width: 479px) {
    .product-card {
        border-radius: 10px;
        border-width: 1px;
    }

    .product-card img {
        height: 185px; /* Slightly larger photo for 2-col mobile layout */
    }

    .product-info {
        padding: 12px 8px; /* Tighter padding */
    }

    .product-card h3 {
        font-size: 0.95rem; /* Smaller title */
        margin-bottom: 5px;
        min-height: auto; /* Allow natural height */
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .product-short-desc {
        display: -webkit-box; /* One short line, like photo5 */
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.78rem;
        margin-bottom: 0;
        white-space: pre-wrap; /* Preserve line breaks */
        word-wrap: break-word;
    }

    .product-card .product-price {
        font-size: 1.1rem;
    }
}

.product-card {
    background: linear-gradient(135deg, #252525 0%, #1f1f1f 100%);
    border: 2px solid #333;
    border-radius: 12px;
    padding: 0;
    text-align: center;
    transition: all 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(153, 189, 3, 0.2);
}

.product-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Mobile product-card - simpler */
@media (max-width: 479px) {
    .product-card {
        border-radius: 10px;
        border-width: 1px;
    }
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(153, 189, 3, 0.12);
}

/* Subtle hover on mobile */
@media (max-width: 768px) {
    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(153, 189, 3, 0.1);
    }
}

.product-view-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #88a802 100%);
    color: #111;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.product-view-btn:hover {
    background: linear-gradient(135deg, #88a802 0%, var(--primary-color) 100%);
    transform: translateX(3px);
}

@media (max-width: 479px) {
    .product-view-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

.product-card img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
}

/* Mobile image - a bit larger for 2-column layout */
@media (max-width: 479px) {
    .product-card img {
        height: 185px;
    }
}

/* Tablet - medium size */
@media (min-width: 480px) and (max-width: 767px) {
    .product-card img {
        height: 195px;
    }
}

/* Desktop */
@media (min-width: 768px) {
    .product-card img {
        height: 210px;
    }
}

.product-card:hover img {
    opacity: 0.95;
}

.product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mobile info - compact */
@media (max-width: 479px) {
    .product-info {
        padding: 8px;
        gap: 6px;
    }

    .category-add-to-cart-form {
        gap: 6px;
    }

    .category-add-to-cart-form .btn-add-to-cart {
        min-width: 46px;
        padding: 8px 10px;
        min-height: 40px;
    }

    .category-add-to-cart-form .qty-btn-category {
        padding: 0;
        min-height: 38px;
        font-size: 1.25rem;
    }

    .category-add-to-cart-form .quantity-input-category {
        min-width: 26px;
        padding: 5px 2px;
        font-size: 0.95rem;
    }
}

/* Додаємо стилі для групування кнопки і форми внизу */
.product-info .category-more-link {
    margin-top: auto;
    margin-bottom: 0;
}

.product-info .category-add-to-cart-form {
    margin-top: 8px;
    margin-bottom: 0;
}

.product-card h3 {
    font-size: 1rem;
    margin: 0 0 6px 0;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.35;
    min-height: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Mobile - compact text */
@media (max-width: 479px) {
    .product-card h3 {
        font-size: 0.95rem;
        margin-bottom: 6px;
        line-height: 1.3;
    }
}

.product-short-desc {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word;
}

/* Mobile - hide description for cleaner look */
@media (max-width: 479px) {
    .product-short-desc {
        font-size: 0.85rem;
    }
}

.product-card .product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Mobile price */
@media (max-width: 479px) {
    .product-card .product-price {
        font-size: 1.15rem;
    }
}

.product-card .btn-primary {
    background-color: #1a1a1a;
    color: #ffffff;
    border: 2px solid #d4a017;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Mobile button - more rounded and slightly smaller */
@media (max-width: 768px) {
    .product-card .btn-primary {
        padding: 8px 14px;
        font-size: 0.85rem;
        border-radius: 22px;
    }
}

.product-card .btn-primary:hover {
    background-color: #000000;
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 160, 23, 0.6);
}

.btn-small {
    padding: 10px 16px;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
}

@media (max-width: 479px) {
    .btn-small {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
}


.product-info h3 {
    margin: 0 0 10px 0;
}

.product-info h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.product-short-desc {
    color: #a0a0a0;
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word;
}

.product-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

/* Desktop layout - horizontal */
@media (min-width: 769px) {
    .product-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
}

/* New category product card styles */
.product-name {
    margin-bottom: 8px;
    min-height: 2.4em; /* Reserve space for 2 lines */
}

.product-name a {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}

.top-products-section .product-name {
    width: 100%;
    margin: 0 0 8px;
    min-height: 2.4em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}

.top-products-section .product-name a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    line-height: 1.2;
    white-space: normal !important;
    text-indent: 0;
}

.top-products-section {
    padding: 20px 0 8px;
}

.top-products-section .section-title {
    margin-bottom: 4px;
    padding: 0 8px;
}

.top-products-section .title-separator {
    margin-bottom: 14px;
}

.top-products-section .products-grid {
    margin-top: 18px;
}

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

/* Product badges */
.product-badge-stack {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: calc(100% - 16px);
    pointer-events: none;
}

.product-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.28);
}

.product-badge--new {
    background: #e53935;
    box-shadow: 0 2px 6px rgba(229,57,53,0.4);
}

.product-badge--in-stock {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34,197,94,0.35);
}

.product-badge--hit {
    background: linear-gradient(135deg, #ff6a00, #ff2d55);
    box-shadow: 0 2px 8px rgba(255,106,0,0.35);
}

.product-badge--sale {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}

.product-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.product-detail-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.28);
}

.product-detail-badge--new {
    background: #e53935;
}

.product-detail-badge--in-stock {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.product-detail-badge--hit {
    background: linear-gradient(135deg, #ff6a00, #ff2d55);
}

.product-detail-badge--sale {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

@media (max-width: 480px) {
    .product-badge {
        font-size: 0.56rem;
        padding: 4px 7px;
    }

    .product-detail-badge {
        font-size: 0.68rem;
        padding: 6px 10px;
    }
}

.product-image-link {
    position: relative;
    display: block;
}

.product-short-desc {
    color: #a0a0a0;
    font-size: 0.8rem;
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word;
}

.product-price-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
    padding: 10px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.product-availability {
    font-size: 0.8rem;
    font-weight: 600;
}

.product-availability.in-stock {
    color: #90ee90;
}

.product-availability.out-of-stock {
    color: #ff6b6b;
}

/* Card cart form: qty control and bag-icon button in one row (photo5 style) */
.category-add-to-cart-form {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
}

.category-add-to-cart-form .category-quantity-control {
    flex: 1;
    min-width: 0;
}

.category-add-to-cart-form .btn-add-to-cart {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 8px 16px;
}

.category-add-to-cart-form .btn-add-to-cart span {
    display: none;
}

.category-add-to-cart-form .btn-add-to-cart i {
    font-size: 1.05rem;
}

.category-quantity-control {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 2px solid #333;
    border-radius: 8px;
    background: #2a2a2a;
    overflow: hidden;
}

.qty-btn-category {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 40px;
}

.qty-btn-category:hover {
    background: #333;
}

.qty-btn-category:active {
    background: #3a3a3a;
}

.quantity-input-category {
    flex: 1 1 0;
    border: none;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    background: transparent;
    text-align: center;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 700;
    padding: 6px 2px;
    pointer-events: none;
    min-width: 40px;
}

.quantity-input-category::-webkit-outer-spin-button,
.quantity-input-category::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add-to-cart {
    background: linear-gradient(135deg, var(--primary-color) 0%, #88a802 100%);
    color: #111;
    border: none;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 36px;
}

.btn-add-to-cart span {
    white-space: nowrap;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: linear-gradient(135deg, #aad404 0%, #99bd03 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(153, 189, 3, 0.4);
}

.btn-add-to-cart:hover:not(:disabled) i {
    animation: cartBounce 0.5s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.btn-add-to-cart:active:not(:disabled) {
    transform: translateY(0);
}

.btn-add-to-cart:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-add-to-cart i {
    font-size: 1rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .product-name {
        min-height: 2.6em; /* More space on mobile for longer names */
    }

    .product-name a {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .qty-btn-category {
        font-size: 1.3rem;
        padding: 0;
        min-height: 42px;
    }

    .btn-add-to-cart {
        padding: 14px 18px;
        min-height: 46px;
    }
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
    text-align: center;
}

.product-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.product-price-old {
    color: #ff6b6b;
    font-size: 1.1rem;
    text-decoration: line-through;
    text-decoration-thickness: 0.8px;
    opacity: 0.85;
    font-weight: 600;
}

.product-price-new {
    color: #99bd03;
}

@media (max-width: 768px) {
    .product-price {
        font-size: 1.05rem;
    }

    .product-price-old {
        font-size: 0.92rem;
    }
}

.add-to-cart-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

/* Desktop - form takes remaining space */
@media (min-width: 769px) {
    .add-to-cart-form {
        flex: 1;
        max-width: 200px;
    }
}

.quantity-input {
    width: 60px;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 768px) {
    .quantity-input {
        width: 50px;
        padding: 6px;
    }
}

/* Button takes remaining space */
.add-to-cart-form .btn {
    flex: 1;
    white-space: nowrap;
    padding: 8px 12px;
    min-height: 40px;
}

@media (max-width: 768px) {
    .add-to-cart-form .btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* Top Products Section */
/* Top Products Section */
.top-products-section {
    text-align: center;
    padding: 40px 15px;
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.3) 0%, rgba(42, 42, 42, 0.2) 100%);
    border-radius: 16px;
    margin: 30px auto;
    max-width: 100%;
    width: 100%;
    overflow-x: visible;
}

@media (max-width: 768px) {
    .top-products-section {
        padding: 30px 10px;
        margin: 20px auto;
    }
}

.top-products-section .container {
    max-width: 100%;
    padding: 0 15px;
    overflow-x: visible;
}

.top-products-section .category-add-to-cart-form {
    margin-top: 8px;
}

.top-products-section .category-more-link {
    margin-top: 8px;
}


/* Category Products Section */
.category-products {
    padding: 25px 15px;
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.3) 0%, rgba(42, 42, 42, 0.2) 100%);
    border-radius: 16px;
    margin: 6px auto 10px;
    max-width: 1400px;
    overflow: visible !important;
    overscroll-behavior: auto;
    touch-action: pan-y;
}

.category-video + .category-products {
    margin-top: 2px;
}

/* Mobile category products */
@media (max-width: 768px) {
    .category-products {
        padding: 18px 10px;
        margin: 4px auto 8px;
    }

    .category-video + .category-products {
        margin-top: 0;
    }
}

/* Category products grid - better spacing */
.category-products .products-grid {
    gap: 20px;
    overflow: visible !important;
    max-height: none !important;
    touch-action: pan-y;
}

@media (min-width: 768px) {
    .category-products .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1100px) {
    .category-products .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
    }
}

/* Category product cards - adaptive height */
.category-products .product-card {
    min-height: 350px; /* Збільшено для довгих назв */
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .category-products .product-card {
        min-height: 320px; /* Збільшено для мобільних */
    }
}

.category-products .product-info {
    padding: 15px;
    align-items: center;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
}

/* LAST override: category short description centered + larger */
.category-products .product-info {
    align-items: center !important;
    text-align: center !important;
}

.category-products .product-name {
    width: 100%;
    min-height: 2.6em;
    margin: 0 0 8px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.category-products .product-name a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    white-space: normal;
    min-height: 2.4em;
}

.category-products .product-short-desc.category-short-desc {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 8px auto 12px auto !important;
    min-height: 3.1em !important;
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.category-products .product-price-block {
    width: 100%;
    margin-top: auto;
}

@media (max-width: 479px) {
    .category-products .product-short-desc.category-short-desc {
        font-size: 0.9rem !important;
        margin: 4px auto 6px auto !important;
        min-height: 3.5em !important;
        line-height: 1.3 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}

.category-header {
    text-align: center;
    padding: 20px 15px 6px;
    margin: 0 auto;
    max-width: 1400px;
}

.category-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .category-title {
        font-size: 1.5rem;
    }
}

.category-description {
    color: #c0c0c0;
    font-size: 1rem;
    max-width: 800px;
    margin: 0 auto 4px;
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word;
}

.category-breadcrumb {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.breadcrumb a:hover {
    color: #88a802;
    text-decoration: underline;
}

.breadcrumb span {
    color: #666;
}


/* Product placeholder for missing images */
.product-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px 14px 0 0;
    color: #666;
    font-weight: 600;
    border-bottom: 2px solid #333;
}

.review-placeholder,
.about-shop-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #666;
    font-weight: 600;
}

.btn-small {
    padding: 10px 18px;
    font-size: 0.85rem;
    width: 100%;
}

@media (max-width: 479px) {
    .btn-small {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
}

.placeholder-message {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 1.05rem;
    background: rgba(25, 25, 25, 0.5);
    border-radius: 12px;
}

/* Product Details Page */
.breadcrumb-section {
    padding: 20px 0;
    border-bottom: 1px solid #333;
}

.product-details {
    padding: 30px 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.product-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (min-width: 769px) {
    .product-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .product-details-grid {
        gap: 20px;
    }

    .product-details-info {
        position: relative;
        padding-bottom: 20px;
    }
}

.product-details-image {
    position: relative;
    width: 100%;
}

@media (min-width: 769px) {
    .product-details-image {
        position: sticky;
        top: 80px;
    }
}

/* Product Gallery */
.product-gallery {
    width: 100%;
    max-width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.gallery-main-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid #333;
    background: #1a1a1a;
    flex-shrink: 0;
}

.detail-image-btn {
    display: block;
    width: 100%;
    border: none;
    padding: 0;
    background: none;
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.detail-image-btn .detail-image {
    width: 100%;
    height: 500px;
    object-fit: contain;
    display: block;
    border-radius: 0;
    border: none;
    background: #1a1a1a;
    transition: transform 0.4s ease;
}

@media (max-width: 768px) {
    .detail-image-btn .detail-image {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .detail-image-btn .detail-image {
        height: 280px;
    }
}

.detail-image-btn:hover .detail-image {
    transform: scale(1.03);
}

.zoom-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}

.detail-image-btn:hover .zoom-hint {
    opacity: 1;
}

/* Gallery Navigation Arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(153, 189, 3, 0.8);
    color: #000;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 15px;
}

.gallery-nav.next {
    right: 15px;
}

@media (max-width: 768px) {
    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .gallery-nav.prev {
        left: 10px;
    }

    .gallery-nav.next {
        right: 10px;
    }
}

/* Gallery Thumbnails */
.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 0 0 10px 0;
    width: 100%;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #a9c41c;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid #444;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-thumb:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(153, 189, 3, 0.3);
}

.gallery-thumb.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(153, 189, 3, 0.5);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .gallery-thumb {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
}

.detail-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid #333;
    background: #1a1a1a;
}

@media (max-width: 768px) {
    .detail-image {
        max-height: 400px;
    }
}

.product-placeholder-large {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: 600;
}

.product-detail-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .product-detail-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
}

.product-category {
    margin-bottom: 15px;
}

.product-category a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.product-category a:hover {
    text-decoration: underline;
}

.product-detail-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.price-old {
    color: #ff6b6b;
    font-size: 1.8rem;
    text-decoration: line-through;
    text-decoration-thickness: 0.8px;
    opacity: 0.8;
    font-weight: 600;
}

.price-value {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: bold;
}

@media (max-width: 768px) {
    .price-old {
        font-size: 1.2rem;
    }

    .price-value {
        font-size: 1.8rem;
    }
}

.product-specs {
    margin-bottom: 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 14px 15px;
}

.product-specs-title {
    margin: 0 0 10px;
    color: #f0f0f0;
    font-size: 1rem;
}

.product-specs-list {
    display: grid;
    gap: 8px;
}

.product-spec-item {
    font-size: 0.93rem;
    line-height: 1.45;
}

.spec-label {
    color: #9ca3af;
    font-weight: 600;
}

.spec-value {
    color: #f3f4f6;
}

.product-detail-description {
    margin-bottom: 20px;
}

.product-detail-description h3 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .product-detail-description h3 {
        font-size: 1rem;
    }
}

.product-detail-description p {
    color: #d9d9d9;
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-wrap; /* Preserves line breaks and spaces */
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .product-detail-description p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

.product-availability {
    margin-bottom: 20px;
    padding: 12px;
    background: #2a3a2a;
    border-radius: 8px;
}

.in-stock {
    color: #90ee90;
    font-weight: 600;
}

.product-add-to-cart {
    margin-bottom: 25px;
}

.quantity-selector {
    margin-bottom: 20px;
}

.quantity-selector label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #2a2a2a;
    width: fit-content;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.3rem;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover {
    background: #333;
}

.qty-btn:active {
    background: #444;
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .qty-btn {
        padding: 12px 18px;
        font-size: 1.4rem;
    }
}

.quantity-input-detail {
    width: 60px;
    border: none;
    background: transparent;
    text-align: center;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

.quantity-input-detail::-webkit-outer-spin-button,
.quantity-input-detail::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-large {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1rem;
}

.product-actions {
    margin-top: 25px;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-link:hover {
    text-decoration: underline;
    margin-left: 5px;
}

/* Product Flavor Badge - Bottom Capsule Style */
.product-flavor-badge {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(36%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 26px;
    padding: 0 9px;
    border-radius: 13px;
    font-weight: 700;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: #ffffff;
    white-space: nowrap;
    z-index: 5;
    background: linear-gradient(135deg, rgba(60, 60, 60, 0.95) 0%, rgba(43, 43, 43, 0.98) 100%);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.flavor-icon {
    display: none !important;
}

.flavor-text {
    display: inline-block;
    font-size: 0.58rem;
    line-height: 1;
}

/* Invigorating (Бадьорий) - Green */
.product-flavor-badge--invigorating {
    background: linear-gradient(135deg, #2b7a4b 0%, #215e3b 100%);
    box-shadow: 0 5px 10px rgba(18, 61, 38, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* Intoxicating (П'янкий) - Red */
.product-flavor-badge--intoxicating {
    background: linear-gradient(135deg, #a33434 0%, #7e2424 100%);
    box-shadow: 0 5px 10px rgba(68, 18, 18, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* Relaxing (Розслабляючий) - Orange */
.product-flavor-badge--relaxing {
    background: linear-gradient(135deg, #b06a31 0%, #8d541f 100%);
    box-shadow: 0 5px 10px rgba(60, 31, 15, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .product-flavor-badge {
        height: 24px;
        padding: 0 8px;
        border-radius: 12px;
        font-size: 0.55rem;
        gap: 0;
        bottom: 2px !important;
    }

    .flavor-text {
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .product-flavor-badge {
        height: 23px;
        padding: 0 7px;
        border-radius: 11px;
        font-size: 0.53rem;
        gap: 0;
        bottom: 1px !important;
    }

    .flavor-text {
        font-size: 0.53rem;
    }
}

/* Optimize product card spacing and margins */
.product-card {
    margin-bottom: 8px;
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-name {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    min-height: 2.8em;
    max-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-short-desc,
.category-short-desc {
    margin: 0;
    padding: 8px 12px;
    background: rgba(153, 189, 3, 0.08);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #b8b8b8;
    text-align: center;
    font-weight: 500;
}

.product-price-block,
.product-price-wrap {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0;
    align-items: baseline;
}

.product-info .product-price-block,
.product-info .product-price-wrap {
    margin-top: auto;
    width: 100%;
}

.category-more-link {
    margin: 4px 0;
}

.category-add-to-cart-form {
    margin: 4px 0;
}

.btn-add-to-cart {
    margin: 0;
    padding: 10px 12px;
    font-size: 0.9rem;
}

/* Minimal gaps between elements */
@media (max-width: 768px) {
    .product-info {
        padding: 10px;
        gap: 6px;
    }

    .product-name {
        font-size: 0.95rem;
        min-height: 2.6em;
        max-height: 2.6em;
    }

    .product-short-desc,
    .category-short-desc {
        padding: 6px 10px;
        font-size: 0.8rem;
        margin-bottom: 0;
    }
}


/* Layout cleanup for product cards */

.product-info {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.product-card h3,
.top-products-section .product-name,
.category-products .product-name,
.product-name {
    min-height: 2.6em !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 0 4px !important;
    display: block !important;
    text-align: center !important;
    line-height: 1.3 !important;
}

.product-card h3 a,
.product-name a,
.top-products-section .product-name a,
.category-products .product-name a {
    display: block !important;
    overflow: visible !important;
    white-space: normal !important;
    max-height: none !important;
    line-height: 1.3 !important;
}

.product-price-block,
.product-price-wrap {
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    gap: 6px !important;
    margin: 4px 0 0 !important;
}

.product-info .product-price-block,
.product-info .product-price-wrap {
    margin-top: auto !important;
}

.product-price-block > *,
.product-price-wrap > * {
    display: inline-flex !important;
    justify-content: center !important;
}

.product-card .product-price,
.product-card .product-price-old,
.product-price,
.product-price-old {
    text-align: center !important;
}

.product-flavor-badge {
    bottom: 4px !important;
    transform: translateX(-50%) translateY(42%) !important;
    height: 34px !important;
    padding: 0 12px !important;
    border-radius: 17px !important;
    gap: 5px !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.3px !important;
    max-width: calc(100% - 18px) !important;
    box-sizing: border-box;
}

.flavor-icon {
    display: none !important;
}

.flavor-text {
    font-size: 0.72rem !important;
    line-height: 1 !important;
}

@media (max-width: 768px) {
    .product-flavor-badge {
        height: 32px !important;
        padding: 0 10px !important;
        border-radius: 16px !important;
        font-size: 0.67rem !important;
        gap: 4px !important;
        max-width: calc(100% - 14px) !important;
        bottom: 3px !important;
    }

    .flavor-icon {
        font-size: 0.8rem !important;
    }

    .flavor-text {
        font-size: 0.67rem !important;
    }

    .product-card h3,
    .top-products-section .product-name,
    .category-products .product-name {
        margin-bottom: 3px !important;
    }
}

@media (max-width: 480px) {
    .product-flavor-badge {
        height: 30px !important;
        padding: 0 9px !important;
        border-radius: 15px !important;
        gap: 4px !important;
        bottom: 2px !important;
    }

    .flavor-icon {
        font-size: 0.8rem !important;
    }

    .flavor-text {
        font-size: 0.64rem !important;
    }
}
