/**
 * Order Summary Dropdown Main Styles
 */

/* WRAPPER & CONTAINER */
.osd-wrapper {
	box-sizing: border-box;
	width: 100%;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
	z-index: 999;
}

/* HEADER AREA */
.osd-header {
	padding: 13px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	position: relative;
	background: #fdfdfd;
	border-bottom: 1px solid transparent;
	transition: background 0.2s ease, border-color 0.2s ease;
}

/* Header States Visibility Toggle */
.osd-state-open {
	display: none;
	align-items: center;
	flex: 1;
	opacity: 0;
	transform: translateX(-10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* STATE: ACTIVE (OPEN) */
.osd-wrapper.is-open .osd-header {
	border-bottom-color: #e5e7eb;
}

.osd-wrapper.is-open .osd-state-closed {
	display: none;
	opacity: 0;
}

.osd-wrapper.is-open .osd-state-open {
	display: flex;
	opacity: 1;
	transform: translateX(0);
}

/* CLOSED STATE: Image & Text */
.osd-state-closed {
	display: flex;
	align-items: center;
	gap: 15px;
	flex: 1;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Image with Badge Logic */
.osd-image-container {
	position: relative;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.osd-img-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 44px;
	height: 44px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	z-index: 1;
	transform: rotate(7deg) translate(2px, -2px);
	transform-origin: bottom right;
}

.osd-img-wrapper {
	position: relative;
	width: 44px;
	height: 44px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.osd-img-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.osd-badge {
	display: none;
}

/* Text Container */
.osd-text-container {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.osd-label-toplam {
	font-size: 16px;
	font-weight: 500;
	color: #111827;
	line-height: 1.2;
}

.osd-count-text {
	font-size: 13px;
	color: #6b7280;
	margin-top: 2px;
}

/* OPEN STATE: Header text */
.osd-label-ozeti {
	font-size: 18px;
	font-weight: 500;
	color: #111827;
}

/* RIGHT SECTION: Price & Chevron */
.osd-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.osd-total-price span {
	font-size: 18px;
	font-weight: 500;
	color: #111827;
}

.osd-chevron {
	display: flex;
	align-items: center;
	color: #374151;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.osd-wrapper.is-open .osd-chevron {
	transform: rotate(180deg);
}

/* COLLAPSIBLE CONTENT AREA */
.osd-content-collapsible {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	background: #fff;
}

/* When the content area is scrollable */
.osd-content-inner {
	max-height: 500px;
	overflow-y: auto;
}

/* Customize scrollbar */
.osd-content-inner::-webkit-scrollbar {
	width: 5px;
}

.osd-content-inner::-webkit-scrollbar-track {
	background: transparent;
}

.osd-content-inner::-webkit-scrollbar-thumb {
	background-color: #e1e1e1 !important;
	border-radius: 10px;
}

/* EMPTY CART STATE */
.osd-wrapper.osd-empty-cart .osd-header {
	opacity: 0.6;
	cursor: default;
}

.osd-wrapper.osd-empty-cart .osd-chevron {
	display: none;
}

/* --- Coupon customizations --- */
.woocommerce-info .dashicons-tag {
	font-size: 18px;
	width: 18px;
	height: 18px;
	vertical-align: middle;
	margin-right: 5px;
	color: #3b3b3b;
}

.woocommerce-info a.showcoupon {
	text-decoration: underline;
	font-weight: 500;
}

/* --- Corporate Invoice Fields --- */
.osd-tax-fields-grid {
    display: flex;
    gap: 20px;
    width: 100%;
}
.osd-tax-fields-grid .osd-half-field {
    flex: none;
    width: auto !important;
    max-width: 50%;
    float: none !important;
    clear: none !important;
    margin-bottom: 0;
}
.osd-tax-fields-grid .osd-half-field input {
    width: 100% !important;
    box-sizing: border-box;
}

/* Hide WooCommerce optional label text */
#osd-corporate-invoice-wrapper .optional {
    display: none !important;
}

@media (max-width: 480px) {
    .osd-tax-fields-grid {
        flex-direction: column;
        gap: 15px;
    }
    .osd-tax-fields-grid .osd-half-field {
        max-width: 100%;
        width: 100% !important;
    }
}

/* --- Theme Compatibility --- */
/* Hide Woodmart Mobile Bottom Navigation Bar specifically on Checkout Page */
body.woocommerce-checkout .wd-toolbar {
    display: none !important;
}

/* --- Mobile Sticky Feature --- */
@media (max-width: 768px) {
	.osd-wrapper.osd-sticky-mobile {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		width: 100% !important;
		z-index: 99999 !important;
		margin: 0 !important;
		border-radius: 0 !important;
		border-left: none !important;
		border-right: none !important;
		border-top: none !important;
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
	}
}