/* Kafkas Webasto: styles for WooCommerce markup (core WC styles are disabled). */

/* Gallery */
.woocommerce-product-gallery { position: relative; }
.woocommerce-product-gallery__wrapper { margin: 0; }
.woocommerce-product-gallery__image { background: #fff; border-radius: 1.25rem; overflow: hidden; }
.woocommerce-product-gallery__image a { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; padding: 1.5rem; }
.woocommerce-product-gallery__image img { width: 100%; height: 100%; object-fit: contain; }
.woocommerce-product-gallery .flex-viewport { border-radius: 1.25rem; border: 1px solid #e2e8f0; background: #fff; }
.woocommerce-product-gallery .kafkas-thumbs { position: relative; margin-top: .75rem; }
.woocommerce-product-gallery .flex-control-thumbs { display: flex !important; flex-wrap: nowrap !important; gap: .5rem; margin: .75rem 0 0; padding: 0 0 .25rem; list-style: none; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.woocommerce-product-gallery .kafkas-thumbs .flex-control-thumbs { margin-top: 0; }
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar { display: none; }
.woocommerce-product-gallery .flex-control-thumbs li { flex: 0 0 4.5rem; width: 4.5rem !important; height: 4.5rem; float: none !important; margin: 0 !important; border: 1px solid #e2e8f0; border-radius: .75rem; background: #fff; padding: .25rem; cursor: pointer; overflow: hidden; scroll-snap-align: start; }
.woocommerce-product-gallery .flex-control-thumbs img { width: 100% !important; height: 100% !important; object-fit: contain; opacity: .55; transition: opacity .2s; }
.woocommerce-product-gallery .flex-control-thumbs li:has(img.flex-active) { border-color: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,.25); }
.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover { opacity: 1; }
.kafkas-gal-arrow { position: absolute; z-index: 8; display: flex; align-items: center; justify-content: center; border-radius: 9999px; background: #fff; color: #0f172a; box-shadow: 0 2px 8px rgba(15,23,42,.25); transition: background .2s, color .2s, transform .2s; }
.kafkas-gal-arrow:hover { background: #0f172a; color: #fff; }
.kafkas-gal-arrow[hidden] { display: none; }
.kafkas-gal-arrow--main { top: calc(50% - 3.5rem); width: 2.5rem; height: 2.5rem; }
.kafkas-gal-arrow--main.kafkas-gal-arrow--prev { left: 1.25rem; }
.kafkas-gal-arrow--main.kafkas-gal-arrow--next { right: 1.25rem; }
.kafkas-gal-arrow--thumb { top: 50%; transform: translateY(-50%); width: 1.75rem; height: 1.75rem; }
.kafkas-gal-arrow--thumb.kafkas-gal-arrow--prev { left: -.35rem; }
.kafkas-gal-arrow--thumb.kafkas-gal-arrow--next { right: -.35rem; }
.woocommerce-product-gallery__trigger { position: absolute; top: .75rem; right: .75rem; z-index: 9; width: 2.25rem; height: 2.25rem; border-radius: 9999px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.15); font-size: 0; }
.woocommerce-product-gallery__trigger::before { content: ""; position: absolute; inset: .55rem; border: 2px solid #0f172a; border-radius: 9999px; width: .8rem; height: .8rem; }
.woocommerce-product-gallery__trigger::after { content: ""; position: absolute; width: 2px; height: .5rem; background: #0f172a; right: .7rem; bottom: .55rem; transform: rotate(-45deg); }

/* Summary */
.product_title { font-size: 1.875rem; line-height: 1.2; font-weight: 900; color: #0f172a; }
.summary .price { display: block; margin-top: .75rem; font-size: 1.5rem; font-weight: 900; color: #0f172a; }
.summary .price del { margin-right: .5rem; font-size: 1rem; color: #94a3b8; font-weight: 600; }
.summary .price ins { text-decoration: none; }
.woocommerce-product-details__short-description { margin-top: 1rem; color: #475569; line-height: 1.7; }

/* Tabs */
.woocommerce-tabs { margin-top: 3rem; }
.woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; border-bottom: 1px solid #e2e8f0; }
.woocommerce-tabs ul.tabs li a { display: block; padding: .75rem 1rem; font-size: .875rem; font-weight: 800; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.woocommerce-tabs ul.tabs li.active a { color: #0f172a; border-color: currentColor; }
.woocommerce-tabs .panel { border-radius: 1.5rem; border: 1px solid #e2e8f0; background: #fff; padding: 1.5rem 1.75rem; color: #475569; line-height: 1.8; }
.woocommerce-tabs .panel > h2:first-child { display: none; }
.woocommerce-tabs .panel h2, .woocommerce-tabs .panel h3 { color: #0f172a; font-weight: 800; margin: 1.5rem 0 .5rem; }
.woocommerce-tabs .panel ul { list-style: disc; padding-left: 1.25rem; margin: .5rem 0 1rem; }
.woocommerce-tabs .panel p { margin: 0 0 1rem; }
.kafkas-specs th, .kafkas-specs td,
.woocommerce-product-attributes th, .woocommerce-product-attributes td { padding: .65rem .75rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.woocommerce-product-attributes { width: 100%; margin-top: 1rem; font-size: .875rem; }
.woocommerce-product-attributes th { width: 33%; text-align: left; color: #475569; font-weight: 600; }
.woocommerce-product-attributes td p { margin: 0; }

/* Related products */
.related.products > h2, .upsells.products > h2 { margin: 3rem 0 1.25rem; font-size: 1.5rem; font-weight: 900; color: #0f172a; }
ul.products { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
ul.products::before, ul.products::after { content: none; }
@media (min-width: 640px) { ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .related ul.products, .upsells ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
ul.products > li { margin: 0; display: flex; min-width: 0; }
ul.products > li > .product-card { width: 100%; }


/* Result count, ordering, pagination */
.woocommerce-result-count { margin: 0; font-size: .875rem; color: #64748b; }
.woocommerce-ordering select { border: 1px solid #e2e8f0; border-radius: .75rem; padding: .5rem 2rem .5rem .75rem; font-size: .875rem; background: #fff; }
.woocommerce-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 3rem 0 0; padding: 0; list-style: none; }
.woocommerce-pagination .page-numbers { display: flex; min-width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; padding: 0 .75rem; border-radius: .75rem; border: 1px solid #e2e8f0; background: #fff; font-size: .875rem; font-weight: 700; color: #475569; }
.woocommerce-pagination .page-numbers.current { background: #0f172a; border-color: #0f172a; color: #fff; }
.woocommerce-info, .woocommerce-message, .woocommerce-error { border-radius: 1rem; padding: 1rem 1.25rem; background: #f8fafc; border: 1px solid #e2e8f0; color: #334155; list-style: none; }

/* Toolbar */
.woocommerce-result-count { font-weight: 600; }
.woocommerce-ordering { margin: 0; }
.woocommerce-ordering select { font-weight: 700; color: #334155; cursor: pointer; }
.woocommerce-breadcrumb a:hover { text-decoration: underline; }

/* Product detail: gallery inside the coloured header */
.kafkas-product-hero .woocommerce-product-gallery { border-radius: 1.5rem; background: #fff; padding: .75rem; box-shadow: 0 20px 40px -20px rgba(15,23,42,.45); }
.kafkas-product-hero .woocommerce-product-gallery .flex-viewport { border: 0; }
.kafkas-product-hero .woocommerce-product-gallery__image a { aspect-ratio: 4 / 3; padding: 1rem; }
.kafkas-product-hero .price { display: inline-block; margin: 0; font-size: 1.75rem; line-height: 1.2; font-weight: 900; color: #fff; }
.kafkas-product-hero .price del { margin-right: .5rem; font-size: 1rem; font-weight: 600; opacity: .7; }
.kafkas-product-hero .price ins { text-decoration: none; }
.kafkas-product-hero .product_title { color: #fff; font-size: 1.875rem; line-height: 1.15; font-weight: 900; }
@media (min-width: 640px) { .kafkas-product-hero .product_title { font-size: 2.25rem; } }
.kafkas-product-hero .price { margin-top: .75rem; }
.kafkas-product-hero .woocommerce-product-details__short-description { margin-top: .75rem; color: rgba(255,255,255,.92); line-height: 1.7; }
.kafkas-product-hero .woocommerce-product-details__short-description p { margin: 0; }
.kafkas-product-more .related.products > h2, .kafkas-product-more .upsells.products > h2 { margin-top: 0; }
.kafkas-product-more .related.products, .kafkas-product-more .upsells.products { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid #e2e8f0; }

/* Shop list view (toggle in the toolbar) */
html body ul.products.kafkas-list { grid-template-columns: minmax(0, 1fr) !important; gap: 1rem; }
html body ul.products.kafkas-list > li > .product-card { flex-direction: row !important; align-items: stretch; }
html body ul.products.kafkas-list .product-image { width: 15rem !important; flex: 0 0 15rem !important; display: flex !important; align-items: center; }
html body ul.products.kafkas-list .product-image > div:last-of-type { aspect-ratio: auto !important; height: 100% !important; min-height: 11rem; }
html body ul.products.kafkas-list .product-card > div:last-child { padding: 1.25rem 1.5rem !important; }
html body ul.products.kafkas-list .product-card h3 { min-height: 0 !important; }
html body ul.products.kafkas-list .product-card h3 + * { }
html body ul.products.kafkas-list .product-card .line-clamp-2.text-xs { -webkit-line-clamp: 3; min-height: 0 !important; }
@media (min-width: 768px) {
    html body ul.products.kafkas-list .product-card > div:last-child { display: grid !important; grid-template-columns: minmax(0, 1fr) 13rem; grid-template-rows: auto auto auto 1fr; column-gap: 1.5rem; }
    html body ul.products.kafkas-list .product-card > div:last-child > * { grid-column: 1; }
    html body ul.products.kafkas-list .product-card > div:last-child > .mt-3.flex.h-6,
    html body ul.products.kafkas-list .product-card > div:last-child > .mt-auto,
    html body ul.products.kafkas-list .product-card > div:last-child > .grid { grid-column: 2; }
    html body ul.products.kafkas-list .product-card > div:last-child > .mt-3.flex.h-6 { grid-row: 1; margin-top: 0 !important; flex-direction: column; align-items: flex-end; height: auto !important; gap: .25rem; }
    html body ul.products.kafkas-list .product-card > div:last-child > .mt-auto { grid-row: 2; margin-top: .75rem !important; padding-top: 0 !important; }
    html body ul.products.kafkas-list .product-card > div:last-child > .grid { grid-row: 3; }
}
@media (max-width: 639px) {
    html body ul.products.kafkas-list > li > .product-card { flex-direction: column !important; }
    html body ul.products.kafkas-list .product-image { width: 100% !important; flex-basis: auto !important; }
}

/* Shop filter rows: check box and count pill */
.kafkas-check { display: flex; flex: none; width: 1.2rem; height: 1.2rem; align-items: center; justify-content: center; border-radius: .4rem; border: 2px solid #cbd5e1; background: #fff; color: transparent; transition: all .15s; }
.kafkas-check svg { width: .75rem; height: .75rem; }
.kafkas-filter-opt:hover .kafkas-check { border-color: #7dd3fc; }
.kafkas-filter-opt input:checked + .kafkas-check { border-color: #0284c7; background: #0284c7; color: #fff; }
.kafkas-filter-opt input:focus-visible + .kafkas-check { box-shadow: 0 0 0 3px rgba(14, 165, 233, .3); }
html body .kafkas-filter-opt:has(input:checked) { background: #f0f9ff; color: #0c4a6e; font-weight: 700; }
.kafkas-count { flex: none; min-width: 1.6rem; padding: .1rem .45rem; border-radius: 999px; background: #f1f5f9; font-size: .68rem; font-weight: 700; line-height: 1.3; color: #64748b; text-align: center; }
.is-on > .kafkas-count, .kafkas-filter-opt:has(input:checked) .kafkas-count { background: #fff; color: #0369a1; }
html body .kafkas-shop-toolbar .woocommerce-result-count { margin: 0; }

/* Shop filters on phones: bottom sheet above the tab bar */
#kafkas-filter-backdrop { display: none; }
.kafkas-sheet-handle { display: flex; justify-content: center; padding: .25rem 0 .5rem; }
.kafkas-sheet-handle span { width: 2.75rem; height: .3rem; border-radius: 999px; background: #cbd5e1; }
@media (max-width: 1023px) {
    html body #kafkas-shop-sidebar.is-open {
        display: block !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10002;
        max-height: 86vh; overflow-y: auto; overscroll-behavior: contain;
        background: #f8fafc; border-radius: 1.5rem 1.5rem 0 0; padding: .75rem 1rem calc(1rem + env(safe-area-inset-bottom));
        box-shadow: 0 -20px 50px -10px rgba(15, 23, 42, .35); animation: kafkasSheetUp .25s ease-out;
    }
    html body #kafkas-filter-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 10001; background: rgba(15, 23, 42, .55); }
    html body #kafkas-shop-sidebar .kafkas-sheet-apply { box-shadow: 0 -12px 20px 6px #f8fafc; }
    html body.kafkas-sheet-lock { overflow: hidden; }
}
@keyframes kafkasSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
/* Results while a filter request is running */
#kafkas-shop-body.is-loading > div:last-child { opacity: .45; pointer-events: none; transition: opacity .15s; }
/* The page list is replaced by loading on scroll (it stays in the HTML for crawlers and no-JS). */
.kafkas-infinite .woocommerce-pagination { display: none; }

/* Shop page (/urunler/): tighter space under the hero */
@media (min-width: 640px) {
    html body.post-type-archive-product .sm\:pb-10 { padding-bottom: 1rem; }
}
