/* Palette */
:root{--sgds-bg:#fff5e6;--sgds-accent:#b0291c;--sgds-accent-contrast:#fff;--sgds-text:#222;--sgds-muted:rgba(0,0,0,.54)}

/* Wrapper */
.sgds-vouchers-block{position:relative;margin:14px 0}
.sgds-vouchers-header{
	display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;
	background:linear-gradient(135deg,#fff9f0 0%,#fff5e6 100%);
	border:1px solid rgba(0,0,0,.06);border-radius:12px;padding:12px 14px
}
.sgds-vouchers-title{font-weight:700;color:var(--sgds-text);min-width:130px}

/* Mini voucher: SVG chip with overlaid text */
.sgds-vouchers-mini{display:flex;flex-wrap:wrap;gap:.5rem}
.sgds-mini-voucher{
	position:relative;display:inline-flex;align-items:center;justify-content:center;
	width:92px;height:44px;padding:0;border:none;background:transparent;color:var(--sgds-accent);
	overflow:visible;
}
.sgds-mini-voucher:before,.sgds-mini-voucher:after{display:none}
.sgds-mini-icon{position:absolute;inset:1px;display:block;overflow:visible}
.sgds-mini-svg{width:100%;height:100%;overflow:visible}
.sgds-mini-text{
	position:relative;z-index:1;color:#fff;font-weight:800;letter-spacing:.02em;
	font-size:12px;line-height:1;max-width:80%;text-align:center;
	text-shadow:0 1px 0 rgba(0,0,0,.2)
}
/* Remove theme hover whitening */
.sgds-mini-voucher:hover,.sgds-mini-voucher:focus{background:transparent!important;color:var(--sgds-accent)!important;box-shadow:none;outline:0}

/* Popover */
.sgds-vouchers-popover{
	position:absolute;left:0;top:calc(100% + 8px);z-index:999999;
	min-width:320px;max-width:760px;width:min(760px,100%);
	background:#fff;border:1px solid rgba(0,0,0,.09);border-radius:12px;
	box-shadow:0 8px 30px rgba(0,0,0,.08);padding:14px;display:none;
}
.sgds-vouchers-block.is-open .sgds-vouchers-popover{display:block;animation:sgdsPop .14s ease-out both}
.sgds-popover-arrow{position:absolute;top:-6px;left:160px;width:12px;height:12px;background:#fff;border-left:1px solid rgba(0,0,0,.09);border-top:1px solid rgba(0,0,0,.09);transform:rotate(45deg)}
@keyframes sgdsPop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.sgds-popover-header{margin:4px 2px 10px 2px}
.sgds-popover-title{font-weight:800;color:#111}
.sgds-popover-sub{font-size:12px;color:var(--sgds-muted);margin-top:2px}
.sgds-voucher-column{display:flex;flex-direction:column;gap:12px;max-height:360px;overflow:auto}
.sgds-popover-footer{margin-top:10px;padding-top:10px;border-top:1px dashed rgba(0,0,0,.15);font-size:12px;color:var(--sgds-muted)}

/* Ticket rows */
.sgds-ticket-row{display:flex;align-items:stretch;background:#fff;border:1px solid rgba(0,0,0,.08);border-radius:10px;overflow:hidden;box-shadow:0 1px 0 rgba(0,0,0,.03)}
.sgds-ticket-left{
	width:110px;min-width:110px;background:var(--sgds-accent);color:#fff;position:relative;
	display:flex;align-items:center;justify-content:center;padding:18px 10px
}
/* left perforation */
.sgds-ticket-left:after{
	content:"";position:absolute;top:0;right:-6px;width:12px;height:100%;
	background:radial-gradient(circle at left center,#fff 6px,transparent 6px) left center/12px 22px repeat-y;
	box-shadow:inset -1px 0 0 rgba(0,0,0,.15)
}
.sgds-ticket-body{flex:1;background:var(--sgds-bg);padding:16px 200px 16px 18px;position:relative;min-height:72px}
.sgds-ticket-title{font-weight:800;font-size:20px;color:#111;margin-bottom:6px}
.sgds-ticket-sub{font-size:14px;color:var(--sgds-text);opacity:.9;margin-top:2px}
.sgds-muted{color:var(--sgds-muted)}

.sgds-ticket-actions{
	position:absolute;right:16px;top:50%;transform:translateY(-50%);
	display:flex;align-items:center;justify-content:center;max-width:40%;text-align:right
}
.sgds-auto-note{
	display:inline-block;background:#fff;border:1px solid rgba(0,0,0,.12);color:#333;
	border-radius:999px;padding:.4rem .7rem;font-weight:700;font-size:12px;line-height:1.2;
	white-space:normal;word-break:break-word;max-width:100%
}

/* Responsive */
@media (max-width:640px){
	.sgds-ticket-left{width:90px;min-width:90px}
	.sgds-ticket-body{padding:14px}
	.sgds-ticket-title{font-size:18px}
	.sgds-ticket-actions{position:static;transform:none;margin-top:10px;max-width:100%;text-align:left}
	.sgds-ticket-body{padding-right:14px}
}

/* Sales count beside rating stars */
.woocommerce div.product .woocommerce-product-rating .sgds-sales-count{display:inline-flex;align-items:center;margin-left:8px;color:var(--sgds-muted);font-size:13px}
.sgds-sales-count .sgds-sales-num{
	font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin-right: 3px;
}

.sgds-sales-count .sgds-sales-text{
    font-size: 1.1rem;
    color: #767676;
}

/* Loop footer (archives/search) */
.sgds-loop-footer{display:flex;align-items:center;justify-content:flex-start;gap:8px;margin-top:4px;font-size:13px;color:var(--sgds-muted);white-space:nowrap}
.sgds-loop-rating{display:inline-flex;align-items:center}
.sgds-loop-sold .sgds-sales-num{font-weight:700;color:#222;margin-right:3px}
.sgds-loop-sold .sgds-sales-text{color:var(--sgds-muted)}
.woocommerce .sgds-loop-footer .star-rating{margin:0;vertical-align:middle}

/* Title spacing + clamping to avoid overflow/smushing */
.woocommerce .products .product .meta-wrapper .product-name,
.woocommerce .products .product .meta-wrapper .heading-title.product-name{margin-bottom:10px!important}
.woocommerce .products .product .meta-wrapper .product-name,
.woocommerce .products .product .meta-wrapper .product-name a{
	display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden
}

/* Make each product card a full-height flex column */
.woocommerce .products .product { display: flex; }
.woocommerce .products .product .product-wrapper{
  display:flex; flex-direction:column; flex:1; /* full height card */
  padding-bottom:0; position:static;          /* no fake bottom padding */
}

/* Keep the “footer row” at the bottom, but in flow */
.woocommerce .products .product .sgds-loop-footer{
  margin-top:auto;          /* pushes it to the bottom of the card */
  display:flex; gap:8px;    /* tidy spacing between rating/sold */
  padding-top:6px;          /* breathing room above footer */
}

/* Enforce a tiny gap between price and footer across all cards */
.woocommerce .products .product .meta-wrapper .price{
  display:block;
  margin:6px 0 4px !important;  /* <-- 3–4px gap under price */
}

/* (Optional) keep action buttons from stretching the card */
.woocommerce .products .product .product-group-button-meta { margin-bottom:8px; }

/* Thin vertical divider between stars and sold */
.sgds-loop-divider{
	display:inline-block;
	width:1px;
	height:12px;
	background:rgba(0,0,0,.2);
	margin:0 2px;
	align-self:center
}