/*
 * Derwaza: our changes on top of the Try Cotton design (try.css).
 * Loaded after try.css on every page.
 */

/* ---------- Colour tokens used by cart.css, checkout.css, account.css (same palette as Try Cotton) ---------- */
:root {
	--dw-bg: #f4efe5;
	--dw-bg-soft: #f8f4ec;
	--dw-bg-alt: #eae1cf;
	--dw-white: #ffffff;
	--dw-ink: #201c17;
	--dw-text: #3a352c;
	--dw-muted: #756c64;
	--dw-line: #e3d9c5;
	--dw-red: #cf2a22;
	--dw-font: "Cairo", "Tahoma", sans-serif;
	--dw-radius-sm: 8px;
	--dw-radius-md: 16px;
	--dw-shadow: 0 10px 30px rgba(32, 28, 23, 0.08);
}

/* ---------- Basics ---------- */
[hidden] { display: none !important; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto; z-index: 100000;
	inset-inline-start: 8px; top: 8px; padding: 10px 16px;
	background: var(--dw-white); color: var(--dw-ink); border-radius: var(--dw-radius-sm);
}
:focus-visible { outline: 2px solid var(--dw-red); outline-offset: 2px; }

/* ---------- One side margin and one content width for the whole site ----------
   Try Cotton used a different side margin per area (10, 14, 16, 24, 48 px; product page
   130 px on desktop), so edges did not line up from one section to the next.
   Every area now uses the same two settings. */
:root {
	--dw-gutter: 16px;                  /* phone */
	--dw-max: 1240px;                   /* widest content, without the side margins */
	--dw-wrap: calc(var(--dw-max) + 2 * var(--dw-gutter));
}
@media (min-width: 600px) { :root { --dw-gutter: 24px; } }
@media (min-width: 1024px) { :root { --dw-gutter: 32px; } }

.tc-container,
.tc-pdp__container { max-width: var(--dw-wrap); padding-inline: var(--dw-gutter); }
.dz-home { --dz-wrap: var(--dw-wrap); --dz-pad: var(--dw-gutter); }
@media (max-width: 768px) {
	.dz-home .dz-features { padding-inline: var(--dw-gutter) !important; }
	.dz-home .dz-cats { padding-inline: var(--dw-gutter) !important; }
}
@media (max-width: 767px) {
	.dz-hero__side-logo { left: var(--dw-gutter); }
}
.tc-pdp__sticky-bar { padding-inline: var(--dw-gutter); }

/* Header icons sit inside round 40 px buttons with about 7 px of empty space at the edge; pull
   the buttons out by that much so the icons line up with the page content below. */
.tc-header__inner { padding-inline: calc(var(--dw-gutter) - 7px); }

/* Spacing that Try Cotton wrote inline in its templates */
.tc-shop-main { padding-block: 30px 60px; }
.tc-page-main { padding-block: 50px; }
.tc-404 { padding-block: 80px; text-align: center; }
.tc-404 p { font-size: 18px; color: var(--tc-muted); margin-bottom: 30px; }
.tc-footer__social { margin-top: 18px; }

/* Try Cotton gave ".woocommerce-checkout" a top margin meant for the form; WordPress puts the
   same class on <body>, which pushed the whole checkout page down. */
body.woocommerce-checkout { margin-top: 0; }

/* Phones: keep the call / WhatsApp buttons above the bottom bars (product "add to cart" bar,
   cart "continue" bar) instead of behind them (Try Cotton glitch, 27 Oct test). */
@media (max-width: 859px) {
	.single-product .dz-fab { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 699px) {
	.woocommerce-cart .dz-fab { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Product page ---------- */

/* WooCommerce's own form stays on the page (it does the real work) but is not shown */
.tc-pdp__form-wrap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Size / colour buttons: one wrapper per option list, laid out by the row itself */
.tc-pdp__btn-group { display: contents; }
.tc-pdp__size-btn:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
/* "نفدت الكمية: s، xxl" under the buttons when some sizes / colours are sold out */
.tc-pdp__sold-note { grid-column: 1 / -1; flex: 0 0 100%; width: 100%; margin-top: 6px; font-size: 13px; font-weight: 600; color: #b32d2e; }
.tc-pdp__sold-note[hidden] { display: none; }

/* Minimum / step note under the quantity */
.tc-pdp__qty-note { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--tc-muted); }

/* Total line: quantity x price of one item or pack. The price above stays fixed. */
.tc-pdp__total {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	margin: 12px 0 0;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--tc-bg-soft);
	border: 1px solid var(--tc-border);
}
.tc-pdp__total-label { font-weight: 700; color: var(--tc-dark); }
.tc-pdp__total-amount { font-size: 20px; font-weight: 800; color: var(--tc-red); }
.tc-pdp__total-calc { margin-inline-start: auto; font-size: 14px; color: var(--tc-muted); }

/* ---------- Contact page block ---------- */
.dw-note { padding: 12px 16px; border-radius: var(--dw-radius-sm); background: #fff4d6; color: var(--dw-ink); }
.dw-contact { margin-top: 20px; }
.dw-contact__text { font-size: 18px; margin: 0 0 20px; }
.dw-contact__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dw-contact__item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	padding: 12px 18px;
	border-radius: var(--dw-radius-md);
	background: var(--dw-white);
	font-weight: 800;
	font-size: 17px;
	color: var(--dw-ink);
	text-decoration: none;
}
.dw-contact__item svg { width: 22px; height: 22px; flex: none; }
.dw-contact__item svg:not([fill]) { fill: currentColor; }
.dw-contact__item:hover { box-shadow: var(--dw-shadow); }
.dw-contact__item--wa { background: #25d366; color: var(--dw-white); }

/* ---------- No sideways scroll, without breaking pinned bars ----------
   Try Cotton used overflow-x: hidden on html/body, which stops position: sticky from working.
   "clip" cuts off the same overflow but keeps sticky elements working. */
html, body { overflow-x: clip !important; }

/* ---------- Added to cart: photo flies into the cart icon, short note under it ---------- */
.dz-fly { position: fixed; z-index: 10000; object-fit: contain; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(32, 28, 23, .25); pointer-events: none; will-change: transform, opacity; }
@keyframes dz-cart-pop { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.28); } 70% { transform: scale(.94); } }
#tc-cart-toggle.dz-cart-pop svg { animation: dz-cart-pop .45s ease; }
.dz-cart-toast {
	position: fixed; z-index: 10000; padding: 7px 12px; border-radius: 999px;
	background: #221e1b; color: #fff !important; font: 700 13px/1.2 "Cairo", Tahoma, sans-serif; text-decoration: none; white-space: nowrap;
	box-shadow: 0 8px 20px rgba(32, 28, 23, .2);
	opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.dz-cart-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.tc-pdp.is-adding #tc-pdp-add-btn, .tc-pdp.is-adding #tc-pdp-buy-btn, .tc-pdp.is-adding #tc-pdp-sticky-add-btn { opacity: .6; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .dz-cart-toast { transition: none; } #tc-cart-toggle.dz-cart-pop svg { animation: none; } }

/* ---------- Shop and category pages ---------- */
/* Phones: the category buttons do the same job as the circles, so only the buttons show. */
@media (max-width: 767px) { .tc-shop-cats-section { display: none !important; } }
/* Category buttons stay pinned under the header while scrolling. */
.tc-shop-tabs-bar {
	position: sticky; top: var(--dw-head-h, 62px); z-index: 40;
	margin-inline: calc(-1 * var(--dw-gutter)); padding: 8px var(--dw-gutter) 2px; width: auto;
	background: var(--tc-bg, #f4efe5); transition: box-shadow .2s ease;
}
.tc-shop-tabs-bar.is-stuck { box-shadow: 0 8px 16px -10px rgba(32, 28, 23, .25); }
.tc-shop-tabs-bar .tc-shop-tabs-scroll { padding-bottom: 8px; }

/* ---------- Side cart: tidy item cards, total and buttons always at the bottom ---------- */
.tc-cart-drawer__header { padding: 16px 20px !important; }
.tc-cart-drawer__body { padding: 14px 16px 0 !important; display: flex; flex-direction: column; }
.tc-cart-drawer .widget_shopping_cart_content { flex: 1; min-height: 0 !important; }
.tc-cart-drawer .woocommerce-mini-cart { flex: 1; }
.tc-cart-drawer .woocommerce-mini-cart-item {
	display: block !important; position: relative; min-height: 88px;
	margin: 0 0 10px !important; padding: 12px 12px 12px 40px !important;
	padding-inline-start: 88px !important; padding-inline-end: 40px !important;
	background: #fff; border: 1px solid #ece4d8 !important; border-radius: 14px;
}
.tc-cart-drawer .woocommerce-mini-cart-item a:not(.remove) {
	display: block !important; margin: 0 0 4px !important; font-size: 14px !important; font-weight: 700 !important; line-height: 1.45 !important;
	color: #221e1b !important; text-transform: uppercase; /* sizes like "l" show as "L" (Arabic has no capitals) */
}
.tc-cart-drawer .woocommerce-mini-cart-item img {
	position: absolute; top: 12px; inset-inline-start: 12px; width: 64px !important; height: 64px !important;
	object-fit: contain !important; border-radius: 10px !important; background: #f6f2ec; margin: 0 !important;
}
.tc-cart-drawer .woocommerce-mini-cart-item .quantity { color: #756c64 !important; font-size: 13px !important; font-weight: 600 !important; }
.tc-cart-drawer .woocommerce-mini-cart-item .quantity .amount { color: #221e1b; font-weight: 800; }
.tc-cart-drawer .woocommerce-mini-cart-item dl.variation { margin: 0 0 2px; font-size: 12.5px; color: #756c64; }
.tc-cart-drawer .woocommerce-mini-cart-item a.remove {
	position: absolute !important; top: 8px; inset-inline-end: 8px; margin: 0 !important;
	width: 30px !important; height: 30px !important; font-size: 20px !important; color: #9a9087 !important; background: transparent;
}
.tc-cart-drawer .woocommerce-mini-cart-item a.remove:hover { background: #f4efe5 !important; color: #cf2a22 !important; }
.tc-cart-drawer .woocommerce-mini-cart__total {
	position: sticky; bottom: 70px; margin: 6px -16px 0 !important; padding: 12px 16px 6px !important;
	background: #fff; border-top: 1px solid #ece4d8 !important; font-size: 16px !important;
}
.tc-cart-drawer .woocommerce-mini-cart__total .amount { font-size: 18px; font-weight: 800; }
.tc-cart-drawer .woocommerce-mini-cart__buttons {
	position: sticky; bottom: 0; flex-direction: row !important; gap: 8px !important;
	margin: 0 -16px !important; padding: 6px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important; background: #fff;
}
.tc-cart-drawer .woocommerce-mini-cart__buttons a.button { flex: 1; width: auto !important; padding: 13px 10px !important; border-radius: 10px !important; font-size: 14.5px !important; letter-spacing: 0 !important; }
.tc-cart-drawer .woocommerce-mini-cart__buttons a.button:not(.checkout) { background: #fff !important; border: 1.5px solid #ded6cc !important; }
.tc-cart-drawer .woocommerce-mini-cart__buttons a.button.checkout { order: -1; background: #221e1b !important; border-color: #221e1b !important; }
.tc-cart-drawer .woocommerce-mini-cart__buttons a.button.checkout:hover { background: #000 !important; border-color: #000 !important; }
.tc-cart-drawer .woocommerce-mini-cart__empty-message { padding: 48px 12px !important; font-size: 16px !important; font-weight: 700; color: #3a352c !important; }
.tc-cart-drawer { height: 100dvh; }
.tc-cart-drawer__title { white-space: nowrap; font-size: 18px !important; }

/* ==========================================================================
   Approved design changes (client OK, Nov 2026). Codes match the PDF
   "Derwaza design suggestions" (docs/design-review/).
   ========================================================================== */

/* G4 / S1: short page titles (shop, categories, cart, checkout, account, policies, search) */
.tc-page-header { padding-block: 12px 8px; text-align: start; background: transparent; border-bottom: 0; }
.tc-page-header h1 { font-size: 24px; line-height: 1.3; margin: 0 0 4px; }
.tc-page-header .tc-breadcrumbs, .tc-page-header .woocommerce-breadcrumb { font-size: 13px; justify-content: flex-start; text-align: start; }
.tc-shop-main { padding-top: 4px; }

/* G2: no number on the cart icon when the cart is empty */
#tc-cart-count.dz-zero { display: none; }

/* G1: the floating WhatsApp button (homepage only) is a little smaller, without the pulse */
.dz-fab__btn--wa { width: 52px; height: 52px; }
.dz-fab *::before, .dz-fab *::after { animation: none !important; }

/* G3: shorter footer on phones: links in two columns, contact details as small buttons */
@media (max-width: 767px) {
	.tc-footer { padding-block: 32px 18px; }
	.tc-footer__grid { grid-template-columns: 1fr 1fr !important; gap: 22px 16px !important; }
	.tc-footer__brand, .tc-footer__col:last-child { grid-column: 1 / -1; }
	.tc-footer__heading { margin-bottom: 8px; font-size: 15px; }
	.tc-footer__col li { margin-bottom: 4px; }
	.tc-footer__col li a { font-size: 14px; }
	.tc-footer__col:last-child ul { display: flex; flex-wrap: wrap; gap: 8px; }
	.tc-footer__col:last-child li { margin: 0; }
	.tc-footer__col:last-child li a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; }
}

/* H4: the drawing next to "قصة تراي" only on tablets and computers */
@media (max-width: 767px) {
	.dz-story__art { display: none; }
	.dz-story { padding-bottom: 36px; }
}

/* S4: tidy product boxes: same white tile behind every photo, name on up to two lines,
   price in bold, "اختر المقاس" button lined up at the bottom */
ul.products li.product { display: flex !important; flex-direction: column; background: #fff; border-radius: 14px; padding: 8px 8px 10px !important; margin-bottom: 14px !important; }
ul.products li.product a.woocommerce-loop-product__link { display: flex; flex-direction: column; flex: 1; }
ul.products li.product img { background: #fff; border-radius: 10px !important; aspect-ratio: 1 / 1; object-fit: contain !important; margin-bottom: 8px !important; }
ul.products li.product .woocommerce-loop-product__title { font-size: 14px !important; line-height: 1.45 !important; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0 !important; margin: 0 0 4px !important; }
ul.products li.product .price { white-space: nowrap; font-size: 13.5px !important; font-weight: 800 !important; color: #221e1b !important; margin: 0 0 8px !important; }
ul.products li.product .button { margin: auto 0 0 !important; width: 100% !important; min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; text-align: center !important; background: #221e1b !important; color: #fff !important; border-radius: 10px !important; padding: 10px 6px !important; font-size: 13.5px !important; }

/* S5: number of products and the sort menu on one line, sort as a small rounded button */
.woocommerce-result-count { font-size: 13px !important; color: #756c64 !important; margin: 0 !important; }
.woocommerce-ordering select { width: auto !important; max-width: 100%; appearance: none; -webkit-appearance: none; border: 1px solid #ded6cc !important; border-radius: 999px !important; background: #fff !important; padding: 8px 16px !important; min-height: 40px; font: 600 13px Cairo, sans-serif !important; color: #221e1b !important; }

/* P4: sizes in neat equal boxes, all of them visible (kids' items with 8 sizes too) */
.tc-pdp__sizes-row { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.tc-pdp__sizes-row .tc-pdp__size-btn { width: auto; min-width: 0; height: 46px; }

/* P1: WhatsApp help link under the buttons */
.dz-help { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 8px 0 0; font-size: 14px; font-weight: 700; color: #1a7f45; text-decoration: none; }
.dz-help svg { width: 18px; height: 18px; fill: currentColor; }

/* Announcement bar: continuous right-to-left scroll with a truck icon (client request, 10 Nov 2026).
   The track is laid out left-to-right and moves left by one row; the second row fills the gap. */
.dz-bar { direction: ltr; }
.dz-bar__track { display: flex; width: max-content; max-width: none; margin: 0; direction: ltr; animation: dz-bar-scroll var(--dz-bar-speed, 40s) linear infinite; }
.dz-bar:hover .dz-bar__track { animation-play-state: paused; }
.dz-bar__row { display: flex; flex-shrink: 0; align-items: center; height: 100%; }
.dz-bar__msg { position: static; inset: auto; opacity: 1; animation: none; display: inline-flex; align-items: center; gap: 8px; padding-inline: 28px; direction: rtl; white-space: nowrap; }
.dz-bar__msg::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: rgba(245, 241, 237, .45); margin-inline-start: 28px; }
.dz-bar__icon { display: inline-flex; width: 20px; height: 20px; color: #f5f1ed; }
.dz-bar__icon svg { width: 100%; height: 100%; transform: scaleX(-1); }
@keyframes dz-bar-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
	.dz-bar__track { animation: none; width: 100%; justify-content: center; }
	.dz-bar__row + .dz-bar__row { display: none; }
	.dz-bar__row .dz-bar__msg:not(:first-child) { display: none; }
	.dz-bar__msg { opacity: 1; }
}

/* Shop / category: products load while scrolling (client request, 10 Nov 2026). */
.dz-infinite .woocommerce-pagination { display: none; }
.dz-more { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; margin: 8px 0 24px; color: #6b625b; font-size: .92rem; }
.dz-more__spin { width: 22px; height: 22px; border: 2px solid #e3d9cf; border-top-color: #221e1b; border-radius: 50%; visibility: hidden; }
.dz-more.is-loading .dz-more__spin { visibility: visible; animation: dz-spin .8s linear infinite; }
.dz-more:not(.is-loading) .dz-more__text { display: none; }
.dz-more__btn { min-height: 44px; padding: 0 26px; border: 1px solid #221e1b; border-radius: 999px; background: #fff; color: #221e1b; font: 600 .95rem 'Cairo', 'Tahoma', sans-serif; cursor: pointer; }
@keyframes dz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dz-more.is-loading .dz-more__spin { animation-duration: 2s; } }

/* Owner notice above the copyright line (company, commercial register, address). Client text, 11 Nov 2026. */
.dz-footer-legal { margin: 0; padding-top: 22px; font-size: 13px; line-height: 1.9; color: #8a8371; text-align: center; max-width: 900px; margin-inline: auto; text-wrap: balance; }
.dz-footer-legal + .tc-footer__bottom { padding-top: 14px; }

/* Text pages (terms, returns, about): show list bullets and space the items. */
.tc-entry-content ul, .tc-entry-content ol { list-style: disc; padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.tc-entry-content ol { list-style: decimal; }
.tc-entry-content li { margin-bottom: .45em; line-height: 1.9; }
.tc-entry-content h2 { margin-top: 1.6em; }

/* About page: intro line and closing tagline (client text, 12 Nov 2026). */
.tc-entry-content .dz-lead { font-size: 1.08em; color: var(--tc-muted); }
.tc-entry-content hr { border: 0; border-top: 1px solid rgba(0, 0, 0, .1); margin: 2em 0 1.4em; }
.tc-entry-content .dz-closing { text-align: center; line-height: 2; }
.tc-entry-content .dz-closing strong { color: var(--tc-red); font-size: 1.15em; }
