/* =========================================================================
   Products page (page-products.php) — layout
   ========================================================================= */

.np-products {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* --- Header: title + sorting --- */
.np-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0 24px;
}

.np-products-title {
    margin: 0;
    font-size: 32px;
    line-height: 1.1;
}

.np-products-sort {
    flex: 0 0 auto;
}

.np-products-sort-select {
    min-width: 220px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

/* --- Reset theme wrappers inside the section --- */
.np-products .content,
.np-products .content_wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* --- Grid: 5 columns --- */
.np-products .product-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

.np-products .np-focus-vignette { min-width: 0; }
.np-products .np-focus-vignette-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;   /* чтобы картинка заполняла ячейку по высоте как карточки */
}

/* Cards fill their grid cell (override any fixed card width) */
.np-products .np-focus-grape-card {
    width: 100%;
    margin: 0;
}

/* Empty state spans the full grid width */
.np-products-empty {
    grid-column: 1 / -1;
    padding: 40px 0;
    color: #666;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .np-products .product-cards-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .np-products .product-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .np-products .product-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .np-products-header { flex-direction: column; align-items: flex-start; }
    .np-products-sort-select { width: 100%; }
}

@media (max-width: 420px) {
    .np-products .product-cards-grid { grid-template-columns: 1fr; }
}

.page-template-products .product-cards-grid {
    display: grid;
    grid-template-columns: repeat(var(--np-products-cols, 5), 1fr);
}

.page-template-products .ecs-title {
    font-style: italic;
    font-weight: 700;
    color: #8A765C;
    font-size: 36px;
    letter-spacing: 2px;
    font-family: 'Cormorant Garamond', serif;
}

.page-template-products .ecs-cat-header .ecs-title {
    font-style: italic;
    font-weight: 700;
    color: #8A765C;
    font-size: 24px;
    letter-spacing: 2px;
    font-family: 'Cormorant Garamond', serif;
}

.page-template-products .np-products-title {
    font-style: italic;
    font-weight: 700;
    color: #8A765C;
    font-size: 36px;
    letter-spacing: 2px;
    font-family: 'Cormorant Garamond', serif;
}

.page-template-products .np-products {
    margin-bottom:60px;
}

.page-template-products .np-products-sort-select {
    padding: 0px 12px;
}


.page-template-products .np-focus-grape-card-image {
    position: relative; /* если ещё не задано */
}
.page-template-products .np-focus-grape-card-image > a {
    display: block;
    position: absolute;
    inset: 0;          /* top:0; right:0; bottom:0; left:0; */
    z-index: 2;        /* поверх картинки, чтобы ловить клик */
}


.page-template-products .np-focus-wine-card-footer {
    margin-bottom: 10px;
}

/* =========================================================================
   SINGLE Products page (page-products.php) — layout
========================================================================= */

/* ===== NON-WINE PRODUCT HERO (scoped) ===== */
.product-hero--non-wine { padding: 32px 0 140px; }
.product-hero--non-wine .npw-grid {
	display: grid;
	grid-template-columns: minmax(0,1fr) minmax(0,1fr);
	gap: 48px;
	align-items: start;
}
.product-hero--non-wine .npw-info { display: flex; flex-direction: column; }

/* Brand */
.product-hero--non-wine .npw-brand { margin-bottom: 28px; min-height: 40px; }
.product-hero--non-wine .npw-brand img { max-height: 56px; width: auto; display: block; }
.product-hero--non-wine .npw-brand__name {
	font-size: 15px; letter-spacing: .12em; text-transform: uppercase;
	color: #b0362f; font-weight: 600;
}

/* Title + subtitle */
.product-hero--non-wine .npw-title {
	font-family: "Cormorant Garamond", serif;
	font-style: italic; font-weight: 700;
	font-size: 48px; line-height: 1.15; margin: 0 0 4px;
}
.product-hero--non-wine .npw-subtitle {
	font-family: Georgia, "Times New Roman", serif;
	font-style: italic; font-size: 18px; color: #555; margin-bottom: 22px;
}

/* Decorative circles */
.product-hero--non-wine .npw-swatches { display: flex; gap: 12px; margin-bottom: 10px; margin-top: 40px; flex-wrap: wrap; }
.product-hero--non-wine .npw-swatch {
	width: 44px; height: 44px; border-radius: 50%;
	background: #e9e5df; border: 1px solid #d9d4cc;
	display: inline-flex; align-items: center; justify-content: center;
}
.product-hero--non-wine .npw-swatch--icon { background: #16455f; border-color: #16455f; }
.product-hero--non-wine .npw-swatch--icon img { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.product-hero--non-wine .npw-swatch--filled { background: #16455f; border-color: #16455f; }

/* Badges + rating */
.product-hero--non-wine .npw-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;     margin-bottom: 60px; }
.product-hero--non-wine .npw-badge {
	font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
	color: #6b6257; background: #ece8e1; border-radius: 4px; padding: 6px 10px; font-weight: 600;
}
.product-hero--non-wine .npw-rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.product-hero--non-wine .npw-rating__star { color: #c0392b; }
.product-hero--non-wine .npw-rating__count { color: #9a9186; font-weight: 500; font-size: 13px; }

/* Description */
.product-hero--non-wine .npw-desc { color: #7a726a; font-size: 13px; line-height: 1.7; margin: 0 0 24px; max-width: 460px; }

/* Divider */
.product-hero--non-wine .npw-divider { border-top: 1px solid #e5e0d8; margin: 4px 0 24px; }

/* Buy row */
.product-hero--non-wine .npw-buy { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.product-hero--non-wine .hero-price-box {
	background: #f1eee9; border-radius: 8px; padding: 14px 16px; min-width: 160px; text-align: right;height: 52px;justify-content: flex-end;
}
.product-hero--non-wine .hero-price-box__value { font-size: 34px; font-weight: 600; color: #007BA5; font-family:"Work Sans",serif; }
.product-hero--non-wine .p_counter {
	display: inline-flex; align-items: center; border: 1px solid #e0dbd3; border-radius: 8px; overflow: hidden;height: 52px !important; line-height: 52px;    width: 62px;
}
.product-hero--non-wine .p_counter > div { padding: 1px 1px; user-select: none; cursor: pointer; 
     line-height: 48px;
    height: 52px; }
.product-hero--non-wine .p_counter .p_number { min-width:18px; text-align: center; cursor: default;    
    }
.product-hero--non-wine .hero-add-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--wiize-accent, #007BA5); color: #fff; text-decoration: none;
	border-radius: 8px; padding: 14px 26px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
	position: relative; transition: background .15s ease;
}
.product-hero--non-wine .hero-add-btn:hover { background: #1a679f; }
.product-hero--non-wine .hero-add-btn img { width: 18px; height: 18px; display: block; }
.product-hero--non-wine .hero-add-btn__icon--spinner,
.product-hero--non-wine .hero-add-btn__icon--check { display: none; }
.product-hero--non-wine .hero-add-btn.is-loading .hero-add-btn__icon--cart,
.product-hero--non-wine .hero-add-btn.is-loading .hero-add-btn__label { visibility: hidden; }
.product-hero--non-wine .hero-add-btn.is-loading .hero-add-btn__icon--spinner {
	display: inline-block; position: absolute; left: 50%; top: 50%;
	width: 16px; height: 16px; margin: -8px 0 0 -8px;
	border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%;
	animation: npwSpin .7s linear infinite;
}
.product-hero--non-wine .hero-add-btn.is-success { background: #2e9e5b; }
.product-hero--non-wine .hero-add-btn.is-success .hero-add-btn__icon--check { display: inline-flex; }
.product-hero--non-wine .hero-add-btn.is-success .hero-add-btn__icon--cart { display: none; }
@keyframes npwSpin { to { transform: rotate(360deg); } }

/* Action icons */
.product-hero--non-wine .hero-action-icons { display: flex; gap: 12px; flex-wrap: wrap; }
.product-hero--non-wine .hero-action {
	width: 44px; height: 44px; border: none; background: #ece8e1; border-radius: 8px;
	display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
	transition: background .15s ease;
}
.product-hero--non-wine .hero-action:hover { background: #e0dbd3; }
.product-hero--non-wine .hero-action img { width: 20px; height: 20px; opacity: .55; }

/* Media / gallery (right column) */
/* The theme forces a decorative frame at several wrapper levels
   (pattern background, min-height:550px, height:100%, display:flex).
   Neutralize all of it so only the image itself shows — with !important
   because the theme rules are equally specific. Works with both the new
   npw-* classes and the old wine classes. */
.product-hero--non-wine .npw-media,
.product-hero--non-wine .product-hero__media-wrap,
.product-hero--non-wine .npw-media__frame,
.product-hero--non-wine .product-hero__media,
.product-hero--non-wine .hero-gallery {
	position: relative !important;
	display: block !important;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	background: none !important;
	padding: 0 !important;
	margin: 0;
	aspect-ratio: auto !important;
}
.product-hero--non-wine .hero-gallery {
	border-radius: 0px;
	overflow: hidden;

}
/* The image defines the box: full column width, natural height, no crop,
   no surrounding frame. */
.product-hero--non-wine .hero-gallery__img {
	display: none;
	position: static !important;
	width: 100% !important;
	height: auto !important;
	max-width: none !important;
	object-fit: contain;
	vertical-align: top;
    border:1px solid #f5f5f5;
}
.product-hero--non-wine .hero-gallery__img.is-active { display: block; }
.product-hero--non-wine .hero-gallery__bars { display: flex; gap: 8px; margin-top: 14px; }
.product-hero--non-wine .hero-gallery__bar {
	flex: 1; height: 5px; border: none; padding: 0; border-radius: 3px; background: #ddd7cd; cursor: pointer;
}
.product-hero--non-wine .hero-gallery__bar.is-active { background: var(--wiize-accent, #1f7ac0); }

/* Cart notice */
.product-hero--non-wine + .wiize-cart-notice,
.wiize-product-wrap .wiize-cart-notice { margin: 0 0 16px; }

/* Responsive */
@media (max-width: 860px) {
	.product-hero--non-wine .npw-grid { grid-template-columns: 1fr; gap: 28px; }
	.product-hero--non-wine .npw-media { order: -1; }
	.product-hero--non-wine .npw-title { font-size: 32px; }
}

.non-wine .hero-gallery__img {
    transform: none !important;
}

