/**
 * Icon Button Styles
 *
 * Header icon buttons (menu, search, cart) and cart link.
 */

/* ===========================================
   ICON BUTTONS
   =========================================== */
.header-icon-btn {
    background: none;
    border: none;
    padding: var(--icon-btn-padding, 8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--header-text, #fff);
}

.header-icon-btn svg {
    width: var(--icon-size, 22px);
    height: var(--icon-size, 22px);
    stroke: currentColor;
    stroke-width: 1.4;
    fill: none;
}

/* ===========================================
   DELIVERY MODE SELECTOR (Desktop Row 1)
   =========================================== */
/* Figma: 135×36px pill, padding: 4px 8px 4px 4px, border-radius: 900px */
.delivery-mode-selector {
    display: none; /* hidden on mobile */
    align-items: center;
    gap: 0;
    padding: 4px 8px 4px 4px;
    height: 36px;
    border-radius: 900px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(17.25px);
    -webkit-backdrop-filter: blur(17.25px);
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.delivery-mode-selector:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Figma: 28×28px circle, emoji clipped to perfect circle */
.delivery-flag {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center; /* show left side of flag (red on UAE, maroon on Qatar) */
    /* padding-left: 3px;            small offset from hard edge */
    transform: translateX();
    font-size: 44px;
    line-height: 1;
    flex-shrink: 0;
    margin-right: 6px;
    /* Force square aspect to keep the circle crisp */
    aspect-ratio: 1 / 1;
}

/* Figma: font-weight: 600, font-size: 13px, line-height: 16px */
.delivery-label {
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 600;
    line-height: 16px;
    color: #fff;
}

/* Chevron path: W10 × H5 (Figma), inside 20×20 container via padding */
.delivery-mode-selector > svg {
    stroke: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    width: 10px;
    height: 6px;
    padding: 7px 5px;
    box-sizing: content-box;
    margin-left: 27px; /* 32px gap (Figma) minus 5px left padding */
}

/* ===========================================
   LANGUAGE SELECTOR (Desktop Row 1)
   =========================================== */
.lang-selector {
    display: none; /* hidden on mobile */
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #fff;
    padding: 4px 2px;
    flex-shrink: 0;
}

.lang-label {
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
}

.lang-selector svg {
    stroke: rgba(255, 255, 255, 0.7);
    fill: none;
}

/* ===========================================
   DESKTOP SEARCH ICON (Row 1, desktop only)
   =========================================== */
.header-desktop-search {
    display: none; /* hidden on mobile */
}

@media (min-width: 1024px) {
    .delivery-mode-selector {
        display: flex;
    }

    .lang-selector {
        display: flex;
    }

    .header-desktop-search {
        display: flex;
    }
}

/* ===========================================
   ACCOUNT PILL (Desktop Row 1 — main header)
   =========================================== */
.header-account-pill {
    display: none; /* hidden on mobile */
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    height: 36px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(17.25px);
    -webkit-backdrop-filter: blur(17.25px);
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-account-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.account-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.account-avatar svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 1.4;
    fill: none;
}

.account-label {
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

.account-chevron {
    width: 10px;
    height: 6px;
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 1.4;
    fill: none;
    flex-shrink: 0;
}

/* Account pill is only used on homepage desktop header */
@media (min-width: 1024px) {
    .homepage-desktop-header .header-account-pill {
        display: flex;
    }
}

/* ===========================================
   CART COUNT BADGE (absolute positioned dot)
   =========================================== */
.cart-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    background: #fff;
    color: #1A1A1A;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* Position wrapper for badge */
.cart-btn {
    position: relative;
}

/* Mobile: dark badge on white bg */
@media (max-width: 1023px) {
    .cart-count-badge {
        background: #1A1A1A;
        color: #fff;
    }
}

/* ===========================================
   WISHLIST BUTTON (Row 1)
   =========================================== */
.header-right .wishlist-trigger {
    position: relative;
}

.header-right .wishlist-trigger svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.4;
    fill: none;
    transition: fill 0.2s ease;
}

.header-right .wishlist-trigger:hover svg {
    fill: currentColor;
}

/* ===========================================
   CART BUTTON (Mobile header)
   =========================================== */
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--header-text, #fff);
    text-decoration: none;
}

.cart-count {
    font-size: 14px;
    color: var(--header-text, #fff);
}

/* Mobile: dark cart count on white background */
@media (max-width: 1023px) {
    .cart-count {
        color: #000000;
    }
}

/* ===========================================
   DESKTOP NAV CART LINK (Row 2)
   =========================================== */
.desktop-cart-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--header-text, #fff);
    text-decoration: none;
    transition: color var(--transition-fast, 0.15s ease);
}

.desktop-cart-link:hover {
    color: var(--header-text-hover, rgba(255, 255, 255, 0.7));
}

.desktop-cart-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
}

.desktop-cart-link .cart-count {
    font-size: 11px;
    color: var(--header-text, #fff);
}

/* ===========================================
   RESPONSIVE ICON SIZES
   =========================================== */

/* Mobile (< 1024px): Icon sizes per Figma at 400px width */
@media (max-width: 1023px) {
    /* Menu toggle: 21px x 14px, 2px stroke per Figma */
    .header-icon-btn.menu-toggle {
        padding: 0;
    }

    .header-icon-btn.menu-toggle svg {
        width: 21px;
        height: 14px;
        stroke-width: 2.5;
        stroke-linecap: round;
    }

    /* Search icon in header-left: 20px per Figma */
    .header-search-icon svg {
        width: 20px;
        height: 20px;
        stroke-width: 1.5;
    }

    /* Wishlist (heart): 18px per Figma */
    .header-right .wishlist-trigger svg {
        width: 20px;
        height: 20px;
        stroke-width: 1.5;
    }

    /* User account: 18px per Figma */
    .header-right .header-icon-btn svg {
        width: 20px;
        height: 20px;
        stroke-width: 1.5;
    }

    /* Cart (shopping bag): 17px per Figma */
    .header-right .cart-btn svg {
        width: 19px;
        height: 19px;
        stroke-width: 1.5;
    }

    .cart-count {
        font-size: 13px;
        font-weight: 500;
    }

    .header-icon-btn {
        padding: 0;
    }
}

/* 1024px-1199px: Compact */
@media (min-width: 1024px) and (max-width: 1199px) {
    .desktop-cart-link svg {
        width: 16px;
        height: 16px;
    }

    .desktop-cart-link .cart-count {
        font-size: 10px;
    }
}

/* 1200px-1399px: Medium */
@media (min-width: 1200px) and (max-width: 1399px) {
    .desktop-cart-link svg {
        width: 18px;
        height: 18px;
    }

    .desktop-cart-link .cart-count {
        font-size: 11px;
    }
}

/* 1400px+: Full */
@media (min-width: 1400px) {
    .desktop-cart-link {
        gap: 5px;
    }

    .desktop-cart-link svg {
        width: 19px;
        height: 19px;
    }

    .desktop-cart-link .cart-count {
        font-size: 12px;
    }
}

/* 1600px+: Extra large */
@media (min-width: 1600px) {
    .desktop-cart-link svg {
        width: 20px;
        height: 20px;
    }

    .desktop-cart-link .cart-count {
        font-size: 13px;
    }
}
