/* ========== Platform Custom CSS ========== */

/* Force light color scheme — Prevents mobile browsers (Samsung Internet "Force Dark Mode",
   Chrome auto-dark, Xiaomi MIUI browser etc.) from inverting page colors.
   Some phones apply OS-level dark mode to websites, causing black backgrounds. */
:root {
    color-scheme: light only;
}

/* Global heading & paragraph margins — override tenant CSS resets */
h1, h2, h3, h4, h5, h6 {
    margin: 20px 0 10px 0 !important;
}

p {
    margin: 0 0 10px 0 !important;
}

p.top-bar-text,
div.top-bar-text {
    margin: 0 !important;
}

div.top-bar-text p {
    margin: 0 !important;
    display: inline;
}

/* Nav icon for mobile menu items */
.menu-item-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

.box-nav-ul .menu-item:hover>.sub-menu {
    background: #fff;
}

/* Nav item-link font weight override */
#header .box-nav-ul .item-link {
    font-weight: 400 !important;
}

/* Nav icon gap override */
#header .nav-icon {
    gap: 14px;
}

#header .nav-icon .nav-icon-item {
    margin-right: 5px;
}

/* All input fields must be 16px (prevents iOS auto-zoom on focus) */
textarea,
input[type=text],
input[type=password],
input[type=datetime],
input[type=datetime-local],
input[type=date],
input[type=month],
input[type=time],
input[type=week],
input[type=number],
input[type=email],
input[type=url],
input[type=search],
input[type=tel],
input[type=color] {
    font-size: 16px !important;
    color: #000 !important;
}

textarea::placeholder,
input::placeholder {
    color: #aaa !important;
}

/* Nav arrow indicator for items with sub-menus */
.box-nav-ul .menu-item.has-submenu>.item-link {
    position: relative;
    padding-right: 20px;
}

.box-nav-ul .menu-item.has-submenu>.item-link::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px !important;
    flex-shrink: 0;
    position: absolute;
    left: auto;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -64 1707 1024'%3E%3Cg transform='scale(1, -1) translate(0, -896)'%3E%3Cpath d='M0 789.333l853.333-853.333 853.333 853.333-151.467 151.467-701.867-701.867-701.867 701.866-151.467-151.466z'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -64 1707 1024'%3E%3Cg transform='scale(1, -1) translate(0, -896)'%3E%3Cpath d='M0 789.333l853.333-853.333 853.333 853.333-151.467 151.467-701.867-701.867-701.867 701.866-151.467-151.466z'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    background-color: currentColor;
}

/* Mobile nav - arrow rotated to point right */
@media (max-width: 991px) {

    .box-nav-ul .menu-item.has-submenu>.item-link::after,
    .mobile-portal-nav .menu-item.has-submenu>.item-link::after {
        transform: translateY(-50%) rotate(-90deg);
    }
}

/* Mobile: hide all nav icons except cart */
@media (max-width: 991px) {

    .nav-icon .nav-search,
    .nav-icon .nav-order-tracking,
    .nav-icon .nav-account,
    .nav-icon .nav-wishlist {
        display: none !important;
    }
}

/* Mobile search bar - sticky below header */
.mobile-search-bar {
    background: #fff;
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid #eee;
}

/* Mobile search trigger - looks like a search input but opens modal */
.mobile-search-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 34px;
    background: #f8f8f8;
    color: #999;
    font-size: 14px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-trigger span:not(.svgi) {
    flex: 1;
}

.mobile-search-trigger i,
.mobile-search-trigger .icon,
.mobile-search-trigger .svgi {
    color: #51b549;
    font-size: 16px;
    flex: 0 0 auto;
}

/* Breadcrumb - always single line */
.tf-breadcrumb-list {
    white-space: nowrap;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991px) {
    .tf-breadcrumb-wrap {
        padding: 7.5px 0 !important;
        gap: 15px;
        font-size: 11px;
    }
}

/* Product page: hide mobile search bar, show magnifier icon instead */
@media (max-width: 991px) {
    .is-product-page .mobile-search-bar {
        display: none !important;
    }

    .is-product-page .nav-icon .nav-search {
        display: flex !important;
    }
}

/* Search offcanvas - full width on mobile */
@media (max-width: 991px) {
    .canvas-search {
        width: 100% !important;
    }

    /* Inside offcanvas, results should be 100% not 100vw */
    .canvas-search .site-search__results {
        width: 100%;
        left: 0;
        transform: none;
    }
}

/* Prevent iOS Safari auto-zoom on input focus (requires >= 16px) */
@media (max-width: 991px) {
    .site-search__input {
        font-size: 16px !important;
    }
}

/* ========== WebView Navigation Bar ========== */
/* Only visible when site is opened inside iOS WKWebView (App Store app) */

.webview-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(54px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.webview-navbar__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 54px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, transform 0.1s ease;
    padding: 0;
}

.webview-navbar__btn:active {
    transform: scale(0.92);
    color: #007AFF;
}

.webview-navbar__btn svg {
    width: 22px;
    height: 22px;
}

.webview-navbar__btn--disabled {
    color: #ccc;
    pointer-events: none;
}

/* Add bottom padding to body when webview navbar is visible */
body:has(.webview-navbar) {
    padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Product page: stack on top of existing 80px product-page padding */
body[data-page-type="product"]:has(.webview-navbar) {
    padding-bottom: calc(80px + 54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Offset ALL fixed/sticky bottom elements when webview navbar is visible */
body:has(.webview-navbar) .progress-wrap {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
}

body:has(.webview-navbar) .whatsapp-widget {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Product page: sticky mobile order bar (Sipariş Ver) */
body:has(.webview-navbar) .sticky-mobile-order-bar {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Theme sticky add-to-cart bar */
body:has(.webview-navbar) .tf-sticky-btn-atc {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Bottom navigation bar (if exists) */
body:has(.webview-navbar) .tf-bottom-navigation,
body:has(.webview-navbar) .mobile-bottom-nav {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Cookie consent bar */
body:has(.webview-navbar) .cc-window,
body:has(.webview-navbar) #cc-main {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Filter apply/clear fixed bar */
body:has(.webview-navbar) .filter-fixed-bottom {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Checkout page: mobile fixed bottom buttons (Satın Al, İleri, Devam Et) */
body:has(.webview-navbar) .checkout-mobile-fixed,
body:has(.webview-navbar) .mobile-fixed-bottom {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ========== NavClient Mobile Menu ========== */

/* Bottom links container (Sipariş Takip, Giriş Yap wrapper) */
.mobile-nav-bottom-links {
    width: 100%;
    margin-top: 0;
}

/* Individual bottom link (Sipariş Takip, Giriş Yap) */
.mobile-nav-bottom-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    width: 100%;
    color: var(--main, #333);
    font-size: 16px;
    font-weight: 400;
    line-height: 19.2px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
}

/* Language/Currency section */
.mobile-nav-lang-currency {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

/* Icon + label wrapper inside menu items */
.menu-item-icon-label {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Simple link variant (no flex:1) */
.menu-item-icon-label-simple {
    display: flex;
    align-items: center;
}

/* ========== Header Switcher Boxes (Lang / Currency) ========== */
/* Hide lang/currency switchers in header on mobile — only show inside hamburger menu */
@media (max-width: 1024px) {
    .nav-icon > .nav-lang,
    .nav-icon > .nav-currency {
        display: none !important;
    }
}

.switcher-box {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    padding: 7px 14px;
    border: thin solid #bbb;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    color: inherit;
}

.switcher-box .switcher-sep {
    margin: 0 5px;
    color: #bbb;
    font-weight: 300;
}

.switcher-box .switcher-item {
    font-weight: 400;
    color: inherit;
}

.switcher-box:has(.switcher-sep) .switcher-item.active {
    font-weight: 700;
}

/* ========== Cart Badge Override ========== */
#header .nav-icon .count-box {
    background-color: var(--color-primary, var(--primary)) !important;
}

/* ========== Footer Icon Protection ========== */
/* Prevent checkout/tenant CSS icon resets from collapsing footer social icons */
#footer .tf-social-icon .box-icon {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#footer .tf-social-icon .box-icon i[class^="icon-"],
#footer .tf-social-icon .box-icon i[class*=" icon-"] {
    width: auto !important;
    height: auto !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

/* ========== Topbar Custom Colors ========== */
/* Applied via CSS variables set from admin panel (--topbar-bg, --topbar-text) */
.tf-top-bar[style*="--topbar-bg"] {
    background-color: var(--topbar-bg) !important;
}

.tf-top-bar[style*="--topbar-text"] {
    color: var(--topbar-text) !important;
}

.tf-top-bar[style*="--topbar-text"] .top-bar-text,
.tf-top-bar[style*="--topbar-text"] .tf-btn.btn-line,
.tf-top-bar[style*="--topbar-text"] .tf-social-icon a,
.tf-top-bar[style*="--topbar-text"] .tf-social-icon i {
    color: var(--topbar-text) !important;
    margin-bottom: 0 !important;
}

.tf-top-bar[style*="--topbar-text"] .tf-social-icon .box-icon {
    border-color: var(--topbar-text) !important;
}

.tf-top-bar[style*="--topbar-padding"] .tf-top-bar_wrap {
    padding: var(--topbar-padding) 0 !important;
}

.tf-top-bar[style*="--topbar-font-size"] .top-bar-text,
.tf-top-bar[style*="--topbar-font-size"] .top-bar-text span,
.tf-top-bar[style*="--topbar-font-size"] .top-bar-text p,
.tf-top-bar[style*="--topbar-font-size"] .tf-btn.btn-line {
    font-size: var(--topbar-font-size) !important;
}

/* ========== CLS Prevention ========== */
/* Reserve space for critical above-fold elements to prevent layout shift (CLS) */

/* Header: prevent CLS on scroll show/hide transitions */
#header {
    min-height: 60px;
    contain: layout style;
}

/* Main banner/slider area: reserve minimum space on mobile */
@media (max-width: 991px) {
    .tf-slideshow,
    .flat-slider,
    [class*="slideshow"],
    .slider-home {
        min-height: 200px;
    }
}

/* Desktop slider reserve */
@media (min-width: 992px) {
    .tf-slideshow,
    .flat-slider,
    [class*="slideshow"],
    .slider-home {
        min-height: 400px;
    }
}

/* ========== Product Image Aspect Ratio ========== */
/* Tenant-configurable via --product-image-ratio CSS custom property */
/* Set from admin panel → CustomAssetsSSR → :root { --product-image-ratio: 3/4; } */

/* Product list cards — override theme's default 1/1.4 ratio */
.card-product .card-product-wrapper {
    aspect-ratio: var(--product-image-ratio, 3/4) !important;
    background-color: #f8f8f8;
}

.card-product .card-product-wrapper img {
    object-fit: contain !important;
    object-position: center !important;
}

/* Product detail — main slider images */
.tf-product-media-main .item,
.product-main-image {
    aspect-ratio: var(--product-image-ratio, 3/4);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
}

.tf-product-media-main .item img,
.product-main-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    max-height: none !important;
}

/* Product detail — thumbnail images */
.tf-product-media-thumbs .item img,
.product-main-slider .swiper-slide img {
    aspect-ratio: var(--product-image-ratio, 3/4);
    object-fit: contain !important;
    background-color: #f8f8f8;
}

/* Responsive: no special overrides needed — aspect-ratio works on all sizes */

/* ========== Swiper Pagination Bullets ========== */
/* Bullets use the icon system: tenants can override shape via IconEditor (--icon-bullet-custom) */
.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,
.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet {
    padding: 10px;
    margin: 2px !important;
}

/* Override default bullet rendering to use mask-image icon system */
.swiper-pagination-bullet {
    background: none !important;
    border-radius: 0 !important;
    position: relative;
    width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px)) !important;
    height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px)) !important;
    opacity: var(--swiper-pagination-bullet-inactive-opacity, .2) !important;
}

.swiper-pagination-bullet::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--swiper-pagination-bullet-inactive-color, #000);
    -webkit-mask-image: var(--icon-bullet-custom, var(--icon-bullet));
    mask-image: var(--icon-bullet-custom, var(--icon-bullet));
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.swiper-pagination-bullet-active {
    opacity: var(--swiper-pagination-bullet-opacity, 1) !important;
}

.swiper-pagination-bullet-active::after {
    background-color: var(--swiper-pagination-color, var(--swiper-theme-color, #007aff));
}

/* sw-dots theme variant: disable default ::before pseudo (icon handles it all) */
.sw-dots .swiper-pagination-bullet::before {
    content: none !important;
}

.sw-dots .swiper-pagination-bullet {
    border: none !important;
}
@media (min-width: 992px) {
    .favorite-btn--mobile{
       display: none !important;
    }
}