/**
 * HS Mobile Drawer — Shoptimizer mobile menu (≤ 992px).
 * Author: Hesham Saad — https://heshamsaad.com
 */

/* The same hook prints the desktop navigation bar: keep the extras mobile-only. */
@media (min-width: 993px) {
	.hs-drawer-head,
	.hs-drawer-social {
		display: none;
	}
}

@media (max-width: 992px) {
	/* Logo */
	.hs-drawer-head {
		display: flex;
		align-items: center;
		min-height: 64px;
		margin: 0 0 6px;
		padding: 18px 0 14px;
		border-bottom: 1px solid #ececec;
	}

	.hs-drawer-logo {
		display: inline-flex;
	}

	.hs-drawer-logo img {
		display: block;
		width: auto;
		height: 28px;
	}

	/* Shoptimizer's RTL stylesheet puts a 20px right margin on every ul and only resets it above 992px: in Arabic the rows stopped short of the logo and widgets. */
	.col-full-nav .shoptimizer-mobile-menu > ul.menu {
		margin: 0;
	}

	/* Main menu rows: more air and a hairline between top-level items */
	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li {
		border-bottom: 1px solid #f1f1f1;
	}

	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li > a {
		padding-top: 13px;
		padding-bottom: 13px;
		font-size: 16px;
	}

	/* Submenu caret: same height as the taller row (13 + 24 + 13), wider tap area. */
	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li.menu-item-has-children > span.caret {
		width: 44px;
		height: 50px;
		align-items: center;
		justify-content: flex-end;
	}

	/* The base rule spins the whole caret box, which swings the end-aligned arrow to the other side: spin only the arrow so it stays put. */
	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li.menu-item-has-children.dropdown-open > span.caret {
		transform: none;
	}

	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li.menu-item-has-children > span.caret::after {
		transition: transform 0.4s;
	}

	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li.menu-item-has-children.dropdown-open > span.caret::after {
		transform: rotate(180deg);
	}

	/* Language switcher reads as a utility, not a category */
	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li.wpml-ls-menu-item {
		border-bottom: 0;
	}

	.col-full-nav .shoptimizer-mobile-menu > ul.menu > li.wpml-ls-menu-item > a {
		font-weight: 600;
	}

	/* Useful Links: two columns, icon beside the label */
	.col-full-nav .mobile-extra {
		padding: 20px 0 8px;
	}

	.col-full-nav .mobile-extra .widget-title,
	.hs-drawer-social__title {
		display: block;
		margin: 0 0 6px;
		color: #777;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
	}

	.col-full-nav .mobile-extra ul.menu {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.col-full-nav .mobile-extra ul li {
		margin: 0;
	}

	.col-full-nav .mobile-extra .menu-item > a {
		display: flex;
		align-items: center;
		gap: 10px;
		height: 100%;
		padding: 12px;
		border: 1px solid #ececec;
		border-radius: 8px;
		color: #222;
		font-size: 14px;
		line-height: 1.25;
	}

	.col-full-nav .mobile-extra .menu-item > a .icon-wrapper {
		display: inline-flex;
		order: -1;
		flex-shrink: 0;
		align-items: center;
		justify-content: center;
		width: 20px;
		height: 20px;
		margin: 0;
		font-size: 20px;
		line-height: 1;
	}

	.col-full-nav .mobile-extra .menu-item > a .icon-wrapper svg {
		width: 20px;
		height: 20px;
	}

	/* Fill the drawer height so the social block can sit at the bottom */
	.col-full-nav .shoptimizer-primary-navigation {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		min-height: 100%;
	}

	/* Social links */
	.hs-drawer-social {
		margin: auto 0 0;
		padding: 18px 0 32px;
		border-top: 1px solid #ececec;
	}

	.hs-drawer-social__list {
		display: flex;
		flex-wrap: wrap;
		gap: 10px;
		margin: 6px 0 0;
		padding: 0;
		list-style: none;
	}

	.hs-drawer-social__list li {
		margin: 0;
	}

	.hs-drawer-social__list a {
		display: grid;
		place-items: center;
		width: 42px;
		height: 42px;
		border: 1px solid #e2e2e2;
		border-radius: 50%;
		color: #222;
		font-size: 12px;
		transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
	}

	.hs-drawer-social__list a:hover,
	.hs-drawer-social__list a:focus-visible {
		border-color: #222;
		background: #222;
		color: #fff;
	}

	.hs-drawer-social__list svg {
		width: 18px;
		height: 18px;
	}
}

/* Header icon menu inside the drawer (Wishlist, Contact, FAQ, My account), 2026-11-26. */
.hs-drawer-icons {
    display: none;
}

@media (max-width: 992px) {
    .hs-drawer-icons {
        display: block;
        margin: 0 1.25em;
        padding: 1em 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    .hs-drawer-icons__list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .hs-drawer-icons__list li {
        margin: 0;
    }

    .hs-drawer-icons__list a {
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        gap: 6px;
        padding: 10px 4px;
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.03);
        color: inherit;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
    }

    .hs-drawer-icons__list .current-menu-item > a,
    .hs-drawer-icons__list a:hover {
        background: rgba(0, 0, 0, 0.07);
    }

    .hs-drawer-icons__list .icon-wrapper,
    .hs-drawer-icons__list .icon-wrapper svg {
        display: block;
        width: 24px;
        height: 24px;
    }
}

/* RTL and alignment fixes (owner request 2026-11-26). */
@media (max-width: 992px) {
    /* Shoptimizer's RTL stylesheet adds margin-right: 20px (and a bottom margin) to every list below 992px: reset it so the tiles and social icons line up with the menu rows. */
    .col-full-nav .hs-drawer-icons__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0;
    }

    .col-full-nav .hs-drawer-social__list {
        margin: 6px 0 0;
    }

    /* Same edges as the menu rows above. */
    .col-full-nav .hs-drawer-icons {
        margin: 0;
    }

    /* Icons drawn in white for the dark footer: use the text colour on the light drawer. */
    .hs-drawer-social__list [fill="#ffffff" i],
    .hs-drawer-social__list [fill="#fff" i],
    .hs-drawer-social__list [fill="white" i] {
        fill: currentColor;
    }

    .hs-drawer-social__list [stroke="#ffffff" i],
    .hs-drawer-social__list [stroke="#fff" i],
    .hs-drawer-social__list [stroke="white" i] {
        stroke: currentColor;
    }

    /* Close button sits on the dimmed page and the news ticker: give it a backdrop so it stays legible. */
    /* Arabic letters must stay joined: no tracking on the RTL section title. */
    [dir="rtl"] .hs-drawer-social__title,
    [dir="rtl"] .col-full-nav .mobile-extra .widget-title {
        letter-spacing: 0;
    }

    .mobile-menu.close-drawer {
        border-radius: 50%;
        background-color: rgba(0, 0, 0, 0.45);
    }
}
