/* Theme Name: LarisManis WP Child
Theme URI: https://www.tokopress.id/downloads/larismanis/
Author: TokoPressID
Author URI: https://www.tokopress.id
Description: A specialized TokoPressID theme optimized for selling products through WooCommerce, especially for the Indonesian market.
Version: 3.5.0
Template: larismanis-wp
Tags: one-column, two-columns, blog, e-commerce
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/

/* Please add your custom CSS code below this line. */

/* 1. Pastikan elemen LI produk memiliki posisi relative */
.woocommerce ul.products li.product {
	position: relative;
}

/* 2. Mengatur posisi badge diskon ke KIRI ATAS di LUAR bingkai gambar */
.woocommerce ul.products li.product .onsale {
	position: absolute;	
	left: -10px;	
	top: -10px;	
	width: auto;	
	max-width: fit-content;
	right: auto;
	bottom: auto;
	z-index: 99;	
	font-size: 10px;	
	padding: 4px 8px;	
	border-radius: 4px;
}

/* Menyembunyikan keseluruhan elemen header halaman (Banner Biru dan Tulisan "Shop") */
.site-header { display: none !important; }

/* Styling untuk kotak total belanja di dashboard */
.total-belanja-info {
	padding: 15px;
	margin-top: 20px;
	border: 1px solid #e1e8ed;
	border-radius: 4px;
	background-color: #ffffff;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.total-belanja-info p { margin-bottom: 0; font-size: 15px; }

/* Sembunyikan banner di halaman Login/Daftar (BELUM LOGIN) */
body.woocommerce-auth .elementor-836,
body.woocommerce-auth .elementor-884,
body.sejowoo-auth .elementor-836 { display: none !important; }

/* Sembunyikan untuk member Platinum, Gold, Silver (menggunakan class dari PHP) */
body.has-upgrade-package .elementor-836 { display: none !important; }

/* KODE TAMBAHAN JIKA ADA USER YANG LOGIN TAPI BUKAN MEMBER (DIASUMSIKAN ID GROUP MEREKA 0) */
body.is-non-member .elementor-836 { display: none !important; }

/* ==================================================================== */
/* KODE BARU: MENENGAHKAN TOMBOL "LIHAT KERANJANG" SAJA DI CHECKOUT */
/* ==================================================================== */
.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-message {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
}
.woocommerce-checkout .woocommerce-message a.button {
	float: none !important;
	display: block !important;
	margin: 10px auto 0 auto !important;
	width: fit-content;
	align-self: center;
}
.woocommerce-checkout .woocommerce-message p {
	width: 100%;
	text-align: left;
}

/* ========================================================================== */
/* FINAL: STYLE FILTER & SORT (Sesuai dengan Gambar) */
/* ========================================================================== */
.woocommerce-products-header {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	flex-wrap: nowrap !important;
	padding: 10px 0 !important;
	margin-bottom: 10px !important;
}
/* backup jika PHP removal gagal */
.woocommerce-products-header .woocommerce-result-count { display: none !important; }

/* Tombol Filter + Dropdown Sort */
.woocommerce-products-header .button,
.woocommerce-products-header .woocommerce-ordering select {
	height: 48px;
	line-height: 24px;
	padding: 10px 15px !important;
	background: #fff;
	border: 1px solid #333 !important;
	color: #333;
	font-size: 16px;
	font-weight: bold;
	border-radius: 5px;
	box-shadow: none !important;
}

/* Grid/List toggle spacing */
.woocommerce-products-header .gridlist-toggle { margin-left: 10px; }

/* ========================================================================== */
/* FINAL PROPORTION FIX (MOBILE VIEW) */
/* ========================================================================== */
@media (max-width: 768px) {
	/* Header filter/sort custom */
	.woocommerce-products-header.df-custom-filter-header {
		display: flex !important;
		align-items: stretch !important;
		width: 100%;
		padding: 10px 0 !important;
		margin-bottom: 10px !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	/* Tombol Filter (18%) */
	.woocommerce-products-header button.button.filter-button {
		flex-basis: 18% !important;
		max-width: 18% !important;
		margin-right: 2% !important;
		margin-left: 0 !important;
		padding: 0 5px !important;
		height: 48px !important;
		line-height: normal !important;
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		white-space: nowrap;
		background-color: #555555;
		color: #fff;
		border-color: #555555 !important;
	}
	/* Sort wrapper (80%) */
	.woocommerce-products-header .df-custom-sort-wrapper {
		flex-basis: 80% !important;
		max-width: 80% !important;
		margin-left: 0 !important;
		align-self: center;
	}
	/* Select full width */
	.woocommerce-products-header .woocommerce-ordering select {
		width: 100%;
		height: 48px !important;
		line-height: normal !important;
		padding-left: 10px !important;
		padding-right: 10px !important;
		border: 1px solid #ccc !important;
		font-weight: bold;
		color: #333;
		background-color: #fff;
		-webkit-appearance: none;
		-moz-appearance: none;
		appearance: none;
		text-align: left;
	}
}

/* ========================================================================== */
/* DISPLAY CONTROL UNTUK TOMBOL CUSTOM DI HEADER */
/* ========================================================================== */
@media (min-width: 769px) {
	.woocommerce-products-header.df-custom-filter-header { display: none !important; }
}
@media (max-width: 768px) {
	.woocommerce-products-header.df-custom-filter-header {
		display: flex !important;
		align-items: stretch !important;
		width: 100%;
	}
}

/* ========================================================================== */
/* FINAL FIX: IZINKAN BLOK FILTER BAWAAN TAMPIL DI MOBILE (JANGAN DIHIDE)     */
/* (REPLACE blok lama yang menyembunyikan filter bawaan)                       */
/* ========================================================================== */
@media (max-width: 768px) {
	/* Penting: biarkan blok filter bawaan tampil */
	.wp-block-woocommerce-product-filters { display: block !important; }
	/* Sembunyikan HANYA tombol overlay bawaan (kita pakai tombol kustom sendiri) */
	.wc-block-product-filters__open-overlay { display: none !important; }
}

/* ========================================================================== */
/* MOBILE FILTER PANEL (slide-in) + OVERLAY                                    */
/* sinkron dengan JS: body.df-filter-open, .df-filter-overlay, .df-close-filter-btn */
/* ========================================================================== */
@media (max-width: 768px) {
	/* Saat panel dibuka: kunci scroll body */
	body.df-filter-open {
		overflow: hidden;
		touch-action: none;
	}

	/* Sidebar kandidat — posisi off-canvas default */
	#secondary,
	.sidebar-primary,
	.widget-area {
		transform: translateX(100%);
		transition: transform .25s ease;
		will-change: transform;
	}

	/* Saat state open: geser masuk */
	body.df-filter-open #secondary,
	body.df-filter-open .sidebar-primary,
	body.df-filter-open .widget-area {
		transform: translateX(0);
	}

	/* State visible: ubah jadi panel fixed */
	#secondary.df-filter-visible,
	.sidebar-primary.df-filter-visible,
	.widget-area.df-filter-visible {
		position: fixed;
		top: 0; right: 0;
		height: 100vh;
		width: 82%;
		max-width: 380px;
		background: #fff;
		z-index: 10001;
		overflow: auto;
		padding: 16px;
		box-shadow: -2px 0 14px rgba(0,0,0,.18);
	}

	/* Overlay gelap */
	.df-filter-overlay {
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,.45);
		z-index: 10000;
		cursor: pointer;
	}

	/* Tombol Tutup */
	.df-close-filter-btn {
		display: block;
		width: 100%;
		margin: -6px 0 12px;
		padding: 10px 12px;
		background: #333;
		color: #fff;
		border: 0;
		border-radius: 6px;
		font-weight: 600;
		text-align: center;
	}

	/* Rapikan widget di panel */
	#secondary.df-filter-visible .widget,
	.sidebar-primary.df-filter-visible .widget,
	.widget-area.df-filter-visible .widget {
		margin-bottom: 16px;
	}
}
