/**
 * Product card (WooCommerce loop) and single product page (PDP).
 */

/* ---------- Product card ---------- */
.apc-product-card {
	border: 1px solid var(--apc-color-border);
	border-radius: var(--apc-radius-lg);
	padding: 14px;
	background: #fff;
	transition: box-shadow 0.18s, transform 0.18s;
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	position: relative;
}
.apc-product-card:hover { box-shadow: 0 16px 32px rgba(16, 40, 34, 0.12); transform: translateY(-3px); text-decoration: none; color: inherit; }
.apc-product-card__media { position: relative; height: 140px; border-radius: 10px; background: var(--apc-color-tint); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; overflow: hidden; }
.apc-product-card__media img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s ease; }
.apc-product-card:hover .apc-product-card__media img { transform: scale(1.05); }
.apc-product-card__media--zoom-alt img.apc-alt-img { position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s ease; }
.apc-product-card:hover .apc-product-card__media--zoom-alt img.apc-alt-img { opacity: 1; }
.apc-product-card__sale-badge { position: absolute; top: 8px; left: 8px; }
.apc-product-card__rx-badge { position: absolute; top: 8px; right: 34px; }
.apc-product-card__wish {
	position: absolute; top: 8px; right: 8px; cursor: pointer; background: rgba(255,255,255,0.9);
	border: none; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
	padding: 0;
}
.apc-product-card__wish svg { stroke: var(--apc-color-danger); pointer-events: none; }
.apc-product-card__wish.is-animating svg { animation: apc-pop-in 0.4s ease; }
.apc-product-card__brand { font-size: 11px; font-weight: 700; color: var(--apc-color-primary); margin-bottom: 3px; }
.apc-product-card__name { font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; min-height: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.apc-product-card__pack { font-size: 11px; color: var(--apc-color-text-faint); margin-bottom: 6px; }
.apc-product-card__rating { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 11.5px; color: var(--apc-color-text-muted); }
.apc-product-card__foot { margin-top: auto; }
.apc-product-card__price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.apc-product-card__price { font-size: 15px; font-weight: 800; color: var(--apc-color-primary); }
.apc-product-card__price-old { font-size: 12px; color: var(--apc-color-disabled); text-decoration: line-through; }
.apc-product-card__add-btn {
	width: 100%; margin-top: 10px; color: #fff; border: none; border-radius: 8px; padding: 10px;
	font-weight: 700; font-size: 12.5px; cursor: pointer; background: var(--apc-color-primary);
	transition: background 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.apc-product-card__add-btn[data-state="added"] { background: var(--apc-color-success); }
.apc-product-card__add-btn[data-state="rx"] { background: var(--apc-color-warning); }
.apc-product-card__add-btn:disabled { background: var(--apc-color-disabled); }
.apc-product-card__add-btn .apc-spinner { display: none; }
.apc-product-card__add-btn.is-loading .apc-spinner { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff; animation: apc-spin 0.6s linear infinite; }
.apc-product-card__add-btn.is-loading .apc-btn-label { display: none; }

/* ---------- Single product page ---------- */
.apc-pdp { max-width: var(--apc-container-max); margin: 0 auto; padding: 24px 20px 100px; }
.apc-pdp__grid { display: grid; grid-template-columns: 440px 1fr; gap: 48px; }
.apc-pdp__gallery-main {
	height: 400px; border-radius: 18px; background: var(--apc-color-tint); display: flex; align-items: center;
	justify-content: center; margin-bottom: 12px; border: 1px solid var(--apc-color-border); overflow: hidden; position: relative;
}
.apc-pdp__gallery-main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.apc-pdp__thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.apc-pdp__thumb {
	width: 76px; height: 76px; border-radius: 10px; background: var(--apc-color-tint); border: 1.5px solid var(--apc-color-border);
	flex-shrink: 0; cursor: pointer; overflow: hidden; padding: 0;
}
.apc-pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.apc-pdp__thumb.is-active { border-color: var(--apc-color-primary); }

.apc-pdp__brand { font-size: 12.5px; font-weight: 700; color: var(--apc-color-primary); margin-bottom: 6px; }
.apc-pdp__title { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.apc-pdp__meta-line { font-size: 13px; color: var(--apc-color-text-muted); margin-bottom: 12px; }
.apc-pdp__rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

.apc-pdp__price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.apc-pdp__price { font-size: 28px; font-weight: 800; color: var(--apc-color-primary); }
.apc-pdp__price-old { font-size: 15px; color: var(--apc-color-disabled); text-decoration: line-through; }
.apc-pdp__discount-chip { font-size: 12.5px; font-weight: 800; color: var(--apc-color-danger); background: var(--apc-color-danger-bg); padding: 3px 8px; border-radius: 6px; }

.apc-pdp__buy-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.apc-pdp__wish-btn { border: 1.5px solid var(--apc-color-border-strong); border-radius: 10px; padding: 10px 14px; background: #fff; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.apc-pdp__wish-btn.is-animating { animation: apc-pop-in 0.4s ease; }
.apc-pdp__cta-row { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.apc-pdp__cta-row > * { flex: 1; min-width: 160px; }

.apc-pdp__trust-row { display: flex; gap: 20px; padding: 16px 0; border-top: 1px solid var(--apc-color-border); margin-bottom: 6px; flex-wrap: wrap; }
.apc-pdp__trust-item { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--apc-color-text-muted); }
.apc-pdp__trust-item svg { stroke: var(--apc-color-primary); flex-shrink: 0; }
.apc-pdp__pharmacist-link { font-size: 12.5px; color: var(--apc-color-info); cursor: pointer; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; background: none; border: none; padding: 0; }

/* Tabs (description / uses / composition / storage / manufacturer) */
.apc-pdp__tabs { margin-top: 28px; }
.apc-pdp__tab { border-bottom: 1px solid var(--apc-color-border); }
.apc-pdp__tab-trigger {
	padding: 14px 4px; width: 100%; display: flex; justify-content: space-between; align-items: center;
	cursor: pointer; font-weight: 700; font-size: 14px; background: none; border: none; text-align: left; color: var(--apc-color-text);
}
.apc-pdp__tab-panel { padding: 0 4px 14px; font-size: 13px; color: var(--apc-color-text-muted); line-height: 1.7; }
.apc-pdp__tab-panel dl { margin: 0; }
.apc-pdp__tab-panel dt { font-weight: 700; color: var(--apc-color-text); margin-top: 10px; }
.apc-pdp__tab-panel dt:first-child { margin-top: 0; }
.apc-pdp__tab-panel dd { margin: 2px 0 0; }

.apc-pdp__related { margin-top: 56px; }
.apc-pdp__related h2 { font-size: 20px; margin: 0 0 18px; }

.apc-pdp__mobile-cta {
	position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--apc-color-border);
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: none; gap: 10px;
	box-shadow: 0 -10px 24px rgba(0,0,0,0.08); z-index: 300;
}
.apc-pdp__mobile-cta > * { flex: 1; }

.apc-rx-notice {
	background: var(--apc-color-warning-bg); border: 1px solid #F0DBA9; border-radius: 12px; padding: 16px 18px;
	margin-bottom: 20px; display: flex; gap: 12px; align-items: flex-start;
}
.apc-rx-notice svg { stroke: var(--apc-color-warning); flex-shrink: 0; margin-top: 1px; }
.apc-rx-notice__title { font-weight: 800; font-size: 14.5px; color: var(--apc-color-warning-strong); margin-bottom: 2px; }
.apc-rx-notice__text { font-size: 12.5px; color: var(--apc-color-warning-strong); }

/* Quantity control (PDP + cart share this pattern) */
.apc-quantity-input { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--apc-color-border-strong); border-radius: 10px; padding: 8px 14px; width: fit-content; }
.apc-quantity-input button { background: none; border: none; cursor: pointer; font-size: 17px; font-weight: 700; color: var(--apc-color-primary); padding: 0 4px; }
.apc-quantity-input input { border: none; width: 32px; text-align: center; font-size: 14px; font-weight: 700; -moz-appearance: textfield; }
.apc-quantity-input input::-webkit-outer-spin-button, .apc-quantity-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Native WooCommerce gallery / add-to-cart form, restyled ---------- */
.woocommerce-product-gallery { position: relative; }
.woocommerce-product-gallery .flex-viewport {
	height: 400px !important; border-radius: 18px; background: var(--apc-color-tint);
	border: 1px solid var(--apc-color-border); overflow: hidden; margin-bottom: 12px;
}
.woocommerce-product-gallery .woocommerce-product-gallery__image img { width: 100%; height: 400px; object-fit: contain; }
.woocommerce-product-gallery .flex-control-thumbs { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.woocommerce-product-gallery .flex-control-thumbs li { width: 76px; height: 76px; }
.woocommerce-product-gallery .flex-control-thumbs img {
	width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--apc-color-border);
	cursor: pointer; opacity: 1;
}
.woocommerce-product-gallery .flex-control-thumbs img.flex-active { border-color: var(--apc-color-primary); }
.woocommerce-product-gallery__trigger { display: none; } /* zoom cursor is enough; PhotoSwipe still opens via WC's own JS */

.apc-pdp__summary form.cart { margin: 0 0 22px; }
.apc-pdp__summary form.cart .quantity {
	display: inline-flex; align-items: center; gap: 12px; border: 1.5px solid var(--apc-color-border-strong);
	border-radius: 10px; padding: 8px 14px; margin-right: 12px; vertical-align: middle;
}
.apc-pdp__summary form.cart .quantity input.qty { border: none; width: 32px; text-align: center; font-size: 14px; font-weight: 700; }
.apc-pdp__summary form.cart .single_add_to_cart_button,
.apc-pdp__summary form.cart button[type="submit"] {
	background: var(--apc-color-primary); color: #fff; border: none; border-radius: 11px; padding: 16px 20px;
	font-weight: 800; font-size: 14.5px; cursor: pointer; min-width: 160px;
}
.apc-pdp__summary form.cart .single_add_to_cart_button:hover { background: var(--apc-color-primary-dark); }
.apc-pdp__summary form.cart .single_add_to_cart_button.disabled { background: var(--apc-color-disabled); cursor: not-allowed; }
.apc-pdp__summary table.variations { width: 100%; margin-bottom: 16px; border-collapse: collapse; }
.apc-pdp__summary table.variations tr { display: block; margin-bottom: 12px; }
.apc-pdp__summary table.variations label { font-size: 12.5px; font-weight: 700; color: var(--apc-color-text-muted); display: block; margin-bottom: 6px; }
.apc-pdp__summary table.variations select {
	width: 100%; border: 1px solid var(--apc-color-border-strong); border-radius: 9px; padding: 12px 14px; font-size: 13.5px;
}
.apc-pdp__summary .woocommerce-variation-price .price,
.apc-pdp__summary .woocommerce-variation { margin-bottom: 14px; font-size: 20px; }
.apc-pdp__summary .woocommerce-variation-availability { margin-bottom: 10px; }
.apc-pdp__summary .reset_variations { font-size: 12px; color: var(--apc-color-text-faint); margin-left: 10px; }
.apc-pdp__summary p.price, .apc-pdp__summary .price { font-size: 28px; font-weight: 800; color: var(--apc-color-primary); }
.apc-pdp__summary p.price ins { text-decoration: none; }
.apc-pdp__summary p.price del { font-size: 15px; color: var(--apc-color-disabled); opacity: 1; margin-right: 8px; }
.apc-pdp__summary .stock.out-of-stock { color: var(--apc-color-danger); font-weight: 700; }

/* Accordion product tabs (see woocommerce/single-product/tabs/tabs.php) */
.apc-pdp__tabs-accordion { margin-top: 28px; }

/* Reviews (native WooCommerce comments, restyled) */
#reviews { max-width: var(--apc-container-max); margin: 40px auto 0; padding: 0 20px 60px; }
#reviews .woocommerce-Reviews-title { font-family: var(--apc-font-display); font-size: 20px; font-weight: 800; }
#reviews #comments ol.commentlist { list-style: none; margin: 0; padding: 0; }
#reviews #comments li.comment {
	border: 1px solid var(--apc-color-border); border-radius: 12px; padding: 18px; margin-bottom: 12px;
}
#reviews .star-rating { color: var(--apc-color-rating); }
#reviews #review_form input, #reviews #review_form textarea {
	border: 1px solid var(--apc-color-border-strong); border-radius: 9px; padding: 10px 12px; width: 100%;
}
#reviews #review_form .form-submit input {
	background: var(--apc-color-primary); color: #fff; border: none; border-radius: 10px; padding: 12px 22px; font-weight: 700;
}
