/* Category pages (products/category-products-2.php) - UX layer, 2026-09-18.
   Scoped to body.etcatp, so the same product cards on search, Buy again and product pages are
   untouched. Restyles only: every id / class categorypage.js and customenew.js use is kept, and
   display is never forced with !important (the cart script toggles .cartbtn / .quantity with
   jQuery show() / hide()). */
.etcatp { --cp-green: #1f3b2c; --cp-lime: #72b01d; --cp-ink: #1f2933; --cp-muted: #6b7785; --cp-line: #eceff3; --cp-bg: #f6f7f5; background: #fafbf9; }

/* ---------- page header + sub-category chips ---------- */
.etcatp .etcat-head { padding: 16px 0 8px; }
.etcatp .etcat-crumbs { font-size: 12.5px; color: var(--cp-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.etcatp .etcat-crumbs a { color: var(--cp-muted); text-decoration: none; }
.etcatp .etcat-crumbs a:hover { color: var(--cp-green); }
.etcatp .etcat-crumbs i { font-size: 10px; opacity: .7; }
.etcatp .etcat-title { font-size: 28px; font-weight: 800; color: var(--cp-ink); margin: 0; letter-spacing: -.2px; }
.etcatp .etcat-sub { color: #555; margin: 4px 0 0; font-size: 15px; }
.etcatp .etcat-subchips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.etcatp .etcat-subchips::-webkit-scrollbar { display: none; }
.etcatp .etcat-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: #fff;
	border: 1px solid #d9dfe6; color: var(--cp-ink); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.etcatp .etcat-chip.is-on { background: var(--cp-green); border-color: var(--cp-green); color: #fff; }
.etcatp .etcat-chip i { color: var(--cp-green); }
.etcatp .etcat-banner { border-radius: 14px; margin-bottom: 10px; }

/* ---------- sort ---------- */
.etcatp .et-sortbar { background: transparent; border-bottom: 0; padding: 4px 0 12px; }
.etcatp .et-sortbar .container { padding: 0 !important; }
.etcatp .et-sortbar label { font-size: 13px; font-weight: 600; color: var(--cp-muted); }
.etcatp #etSortDesktopSelect { width: 230px !important; border-radius: 10px; border: 1px solid #d5dbe3; font-size: 14px; height: 38px; }
.etcatp .et-sortbar .et-chip { font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid #d9dfe6; color: var(--cp-ink); }
.etcatp .et-sortbar .et-chip.active { background: #eef5e6; border-color: var(--cp-lime); color: var(--cp-green); }

/* ---------- product grid (the wrappers come from categorypage.js as col-6 col-md-3) ---------- */
.etcatp #catprobox.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.etcatp #catprobox > * { width: auto; max-width: none; flex: none; padding: 0 !important; margin: 0; min-width: 0; }
.etcatp #catprobox > * > div { height: 100%; }
.etcatp #catprobox .card-style-1 { margin: 0 !important; height: 100%; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--cp-line);
	border-radius: 14px; padding: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.03); transition: box-shadow .15s, border-color .15s; }
@media (hover: hover) { .etcatp #catprobox .card-style-1:hover { box-shadow: 0 8px 22px rgba(16,24,40,.08); border-color: #dfe5dc; } }
.etcatp #catprobox .img-block { display: block; border-radius: 10px; overflow: hidden; background: var(--cp-bg); aspect-ratio: 1 / 1; }
.etcatp #catprobox .img-block > a, .etcatp #catprobox .img-block img { display: block; width: 100%; height: 100%; }
.etcatp #catprobox .img-block img { object-fit: cover; }
.etcatp #catprobox .img-block .notify-badge { left: 6px; top: 6px; border-radius: 8px; background: #b42318; font-weight: 700; font-size: 10.5px; padding: 3px 7px; z-index: 2; }
.etcatp #catprobox .details { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.etcatp #catprobox .title { font-size: 13.5px; font-weight: 600; line-height: 1.3; min-height: 2.6em; margin: 8px 0 6px; color: var(--cp-ink); }
.etcatp #catprobox .sku { margin-bottom: 4px; }
.etcatp #catprobox .sku select { height: 32px; border-radius: 8px; border: 1px solid #d5dbe3; font-size: 12.5px; padding: 4px 26px 4px 8px; }
.etcatp #catprobox .sku .veg-symbol { width: 15px; height: 15px; flex: 0 0 15px; margin-left: 6px; }
.etcatp #catprobox .price { font-size: 17px; color: var(--cp-ink); margin: 4px 0 0; line-height: 1.25; }
.etcatp #catprobox .price small { font-weight: 500; color: var(--cp-muted); }
.etcatp #catprobox .price .mrpblock { font-size: 12px; font-weight: 400; color: var(--cp-muted); }
.etcatp #catprobox .save { background: #eef7e6; color: #1f5f23; border-radius: 8px; font-size: 11px; padding: 4px 7px; margin: 5px 0 0; text-align: left; line-height: 1.3; }
.etcatp #catprobox .save a { color: inherit; }
.etcatp #catprobox .save span { font-size: 11.5px; font-weight: 700; }
.etcatp #catprobox .delivery { font-size: 11px; font-weight: 500; color: var(--cp-muted); letter-spacing: 0; margin-top: 5px; line-height: 1.3; }
.etcatp #catprobox .action, .etcatp #catprobox .details > .quantity { margin-top: auto; padding-top: 8px; }
.etcatp #catprobox .action .cartbtn { width: 100%; margin: 0; border-radius: 10px; font-weight: 700; padding: 8px 6px; font-size: 14px; }
.etcatp #catprobox .quantity { display: flex; align-items: stretch; height: 40px; padding: 0; margin-top: 8px; border: 1.5px solid var(--cp-lime); border-radius: 10px; overflow: hidden; background: #fff; }
.etcatp #catprobox .quantity .minus, .etcatp #catprobox .quantity .plus { width: 40px; flex: 0 0 40px; font-size: 20px; font-weight: 700; background: #eef5e6; color: var(--cp-green); border: 0; border-radius: 0; }
.etcatp #catprobox .quantity .qty { flex: 1; width: auto; min-width: 0; font-size: 16px; font-weight: 700; border: 0; text-align: center; }
.etcatp #catprobox .preorder-box .card-style-1 { background: #fbfaf4; }

/* ---------- loading, more, empty ---------- */
.etcatp .etcat-skel, .etcatp .etcat-empty { display: none; }
.etcatp #catprobox:empty + #load_data_message { display: none; }
.etcatp #catprobox:empty ~ #load_data_message:not(:empty) ~ .etcat-skel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.etcatp .etcat-skel-card { background: #fff; border: 1px solid var(--cp-line); border-radius: 14px; padding: 8px; }
.etcatp .etcat-skel-card span, .etcatp .etcat-skel-card i, .etcatp .etcat-skel-card b { display: block; border-radius: 8px;
	background: linear-gradient(90deg, #eef0f2 25%, #f7f8f9 37%, #eef0f2 63%); background-size: 400% 100%; animation: etcat-shine 1.3s ease infinite; }
.etcatp .etcat-skel-card span { aspect-ratio: 1 / 1; border-radius: 10px; }
.etcatp .etcat-skel-card i { height: 12px; margin-top: 10px; }
.etcatp .etcat-skel-card i + i { width: 60%; }
.etcatp .etcat-skel-card b { height: 34px; margin-top: 12px; border-radius: 10px; }
@keyframes etcat-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .etcatp .etcat-skel-card span, .etcatp .etcat-skel-card i, .etcatp .etcat-skel-card b { animation: none; } }
.etcatp #catprobox:empty ~ #load_data_message:empty ~ .etcat-empty { display: block; }
.etcatp .etcat-empty { text-align: center; background: #fff; border: 1px dashed #d9dfe6; border-radius: 14px; padding: 30px 16px; margin-bottom: 16px; }
.etcatp .etcat-empty i { font-size: 30px; color: #9aa5b1; }
.etcatp .etcat-empty p { margin: 8px 0 14px; color: #555; }
.etcatp #load_data_message .btn-warning { background: transparent; border: 0; color: var(--cp-muted); font-size: 13px; pointer-events: none; box-shadow: none; }
.etcatp #load_data_message .btn-warning::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
	border: 2px solid #d5dbe3; border-top-color: var(--cp-green); border-radius: 50%; animation: etcat-spin .8s linear infinite; }
@keyframes etcat-spin { to { transform: rotate(360deg); } }

/* ---------- about this category ---------- */
.etcatp .etcat-about { background: #fff; border: 1px solid var(--cp-line); border-radius: 14px; padding: 18px 20px; font-size: 15px; line-height: 1.6; color: #333; position: relative; }
.etcatp .etcat-about.is-folded .etcat-about-body { max-height: 240px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.etcatp .etcat-more { margin-top: 8px; border: 0; background: none; color: var(--cp-green); font-weight: 700; padding: 0; }

/* ---------- desktop: side category list ---------- */
@media (min-width: 768px) {
	.etcatp #catprobox.row, .etcatp #catprobox:empty ~ #load_data_message:not(:empty) ~ .etcat-skel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
	.etcatp #catprobox .title { font-size: 14.5px; }
	.etcatp .sidecategory .et-catnav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; border-radius: 14px; border-color: var(--cp-line); padding: 6px; }
	.etcatp .et-catlink { flex-direction: row; text-align: left; align-items: center; gap: 10px; padding: 8px 34px 8px 8px; border-radius: 10px; }
	.etcatp .et-catlink:hover { background: var(--cp-bg); }
	.etcatp .et-caticonwrap { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; }
	.etcatp .et-caticon { width: 28px; height: 28px; }
	.etcatp .et-catname { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
	.etcatp .et-catitem.is-current > .et-catlink { background: #eef5e6; }
	.etcatp .et-catitem.is-current > .et-catlink .et-catname { color: var(--cp-green); font-weight: 800; }
	.etcatp .et-catitem.is-current:before { background: var(--cp-lime); }
	.etcatp .et-cattoggle { top: 12px; right: 6px; width: 24px; height: 24px; background: transparent; }
	.etcatp .et-sublist { margin: 2px 0 6px 48px; padding: 0 0 0 8px; }
	.etcatp .et-sublink { font-size: 13px; padding: 6px 8px; }
	.etcatp .et-sublink.is-active { background: #eef5e6; color: var(--cp-green); font-weight: 700; }
}
@media (min-width: 1200px) {
	.etcatp #catprobox.row, .etcatp #catprobox:empty ~ #load_data_message:not(:empty) ~ .etcat-skel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- phones: full-width grid, chips instead of the side list ---------- */
@media (max-width: 767.98px) {
	.etcatp .sidecategory { display: none; }
	.etcatp .etcat-main { flex: 0 0 100%; max-width: 100%; width: 100%; padding: 0 10px; }
	.etcatp .etcat-head { padding: 12px 10px 6px; }
	.etcatp .etcat-title { font-size: 22px; }
	.etcatp .etcat-sub { font-size: 13.5px; }
	.etcatp .etcat-subchips { padding: 4px 10px 10px; }
	.etcatp .et-sortbar { position: static; padding: 0 0 10px; }
	.etcatp .etcat-about { padding: 14px; font-size: 14px; margin: 0 4px; }
}
