/**
 * Stylesheet: Off-Canvas Cart & Inline Checkout Widget
 *
 * @package Custom_Elementor_Cart_Checkout
 */

/* ==========================================================================
   1. GLOBAL & BODY LOCK
   ========================================================================== */
body.cecc-drawer-open {
	overflow: hidden !important;
	touch-action: none;
}

.cecc-offcanvas-cart-wrapper {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	visibility: hidden;
	transition: visibility 0.4s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	box-sizing: border-box;
}

.cecc-offcanvas-cart-wrapper *,
.cecc-offcanvas-cart-wrapper *::before,
.cecc-offcanvas-cart-wrapper *::after {
	box-sizing: border-box;
}

.cecc-offcanvas-cart-wrapper.cecc-open {
	visibility: visible;
}

/* ==========================================================================
   2. BACKDROP OVERLAY
   ========================================================================== */
.cecc-offcanvas-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(28, 22, 17, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.35s ease;
	cursor: pointer;
}

.cecc-offcanvas-cart-wrapper.cecc-open .cecc-offcanvas-backdrop {
	opacity: 1;
}

/* ==========================================================================
   3. DRAWER PANEL
   ========================================================================== */
.cecc-offcanvas-panel {
	position: absolute;
	top: 0;
	width: 100%;
	max-width: 520px;
	height: 100%;
	background-color: #faf9f7;
	box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
	z-index: 2;
	overflow: hidden;
}

/* Right Slide (Default) */
.cecc-offcanvas-cart-wrapper.pos-right .cecc-offcanvas-panel {
	right: 0;
	transform: translateX(100%);
}

.cecc-offcanvas-cart-wrapper.pos-right.cecc-open .cecc-offcanvas-panel {
	transform: translateX(0);
}

/* Left Slide */
.cecc-offcanvas-cart-wrapper.pos-left .cecc-offcanvas-panel {
	left: 0;
	transform: translateX(-100%);
}

.cecc-offcanvas-cart-wrapper.pos-left.cecc-open .cecc-offcanvas-panel {
	transform: translateX(0);
}

/* ==========================================================================
   4. DRAWER HEADER
   ========================================================================== */
.cecc-offcanvas-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 25px;
	background-color: #ffffff;
	border-bottom: 1px solid #eee8e0;
	flex-shrink: 0;
}

.cecc-drawer-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: #9a7041;
	font-family: Georgia, serif;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cecc-header-count {
	font-size: 16px;
	font-weight: 500;
	color: #777777;
}

.cecc-offcanvas-close {
	background: transparent;
	border: none;
	font-size: 32px;
	line-height: 1;
	color: #443e38;
	cursor: pointer;
	padding: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease, color 0.3s ease;
	outline: none;
}

.cecc-offcanvas-close:hover {
	transform: rotate(90deg);
	color: #9a7041;
}

/* ==========================================================================
   5. DRAWER BODY & SCROLL
   ========================================================================== */
.cecc-offcanvas-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px 25px;
	position: relative;
	display: flex;
	flex-direction: column;
	-webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   6. EMPTY CART VIEW
   ========================================================================== */
.cecc-empty-cart {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 60px 20px;
	margin: auto;
}

.cecc-empty-icon {
	color: #c9bfb5;
	margin-bottom: 20px;
}

.cecc-empty-title {
	font-size: 20px;
	font-weight: 600;
	color: #332d27;
	margin: 0 0 10px;
}

.cecc-empty-desc {
	font-size: 14px;
	color: #7a7066;
	margin: 0 0 25px;
	line-height: 1.5;
}

/* ==========================================================================
   7. CART ITEMS LIST
   ========================================================================== */
.cecc-cart-items-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 20px;
}

.cecc-cart-item {
	display: flex;
	gap: 15px;
	padding: 15px;
	background-color: #ffffff;
	border: 1px solid #eae4dc;
	border-radius: 8px;
	position: relative;
	transition: box-shadow 0.2s ease;
}

.cecc-cart-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.cecc-item-image {
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	border-radius: 6px;
	overflow: hidden;
	background-color: #f5f2ed;
}

.cecc-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cecc-item-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.cecc-item-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
}

.cecc-item-name {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #332d27;
	line-height: 1.3;
}

.cecc-item-name a {
	color: inherit;
	text-decoration: none;
}

.cecc-item-name a:hover {
	color: #9a7041;
}

.cecc-item-remove {
	background: transparent;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: #aba196;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.2s ease;
}

.cecc-item-remove:hover {
	color: #c93b2b;
}

.cecc-item-variations {
	font-size: 12px;
	color: #7a7066;
	margin-top: 4px;
}

.cecc-item-price {
	font-size: 14px;
	font-weight: 600;
	color: #9a7041;
	margin: 6px 0;
}

.cecc-item-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 6px;
}

/* Quantity Controls */
.cecc-qty-control {
	display: inline-flex;
	align-items: center;
	border: 1px solid #dcd5cc;
	border-radius: 4px;
	background-color: #ffffff;
	overflow: hidden;
}

.cecc-qty-btn {
	background: #f8f6f3;
	border: none;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	color: #5c4e42;
	transition: background-color 0.2s ease;
}

.cecc-qty-btn:hover {
	background: #eee8e0;
	color: #9a7041;
}

.cecc-qty-input {
	width: 36px;
	height: 28px;
	text-align: center;
	border: none;
	border-left: 1px solid #dcd5cc;
	border-right: 1px solid #dcd5cc;
	font-size: 13px;
	font-weight: 600;
	color: #332d27;
	outline: none;
	-moz-appearance: textfield;
}

.cecc-qty-input::-webkit-outer-spin-button,
.cecc-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cecc-item-subtotal {
	font-size: 15px;
	font-weight: 700;
	color: #332d27;
}

/* ==========================================================================
   8. CART SUMMARY & COUPONS
   ========================================================================== */
.cecc-cart-summary {
	background-color: #ffffff;
	border: 1px solid #eae4dc;
	border-radius: 8px;
	padding: 20px;
	margin-top: 10px;
}

/* Coupon Form */
.cecc-coupon-section {
	margin-bottom: 20px;
	padding-bottom: 18px;
	border-bottom: 1px dashed #e2dbd1;
}

.cecc-coupon-form {
	display: flex;
	gap: 8px;
}

.cecc-coupon-input {
	flex: 1;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #dcd5cc;
	border-radius: 6px;
	font-size: 13px;
	color: #332d27;
	outline: none;
	transition: border-color 0.2s;
}

.cecc-coupon-input:focus {
	border-color: #9a7041;
}

.cecc-apply-coupon-btn {
	padding: 0 16px;
	height: 40px;
	background-color: #9a7041;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.cecc-apply-coupon-btn:hover {
	background-color: #7e5930;
}

.cecc-applied-coupons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.cecc-coupon-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background-color: #f1ede7;
	border: 1px solid #e0d8ce;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	color: #5c4e42;
}

.cecc-remove-coupon-btn {
	background: transparent;
	border: none;
	font-size: 16px;
	cursor: pointer;
	color: #a04030;
	padding: 0;
}

/* Totals Rows */
.cecc-totals-rows {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cecc-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 14px;
	color: #5c4e42;
}

.cecc-summary-divider {
	height: 1px;
	background-color: #eae4dc;
	margin: 8px 0;
}

.cecc-row-total {
	font-size: 18px;
	font-weight: 700;
	color: #2e2620;
}

.cecc-total-value {
	color: #9a7041;
	font-size: 20px;
}

.text-success {
	color: #27ae60 !important;
}

/* Shipping Selection */
.cecc-shipping-rates {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 8px;
	padding-left: 8px;
}

.cecc-shipping-rate-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	cursor: pointer;
}

/* ==========================================================================
   9. BUTTONS
   ========================================================================== */
.cecc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 16px 20px;
	background-color: #9a7041;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 1px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	outline: none;
}

.cecc-btn:hover {
	background-color: #7e5930;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(154, 112, 65, 0.25);
}

.cecc-cart-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
}

.cecc-continue-shopping-btn {
	background: transparent;
	border: none;
	color: #8c7f72;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	padding: 10px;
	cursor: pointer;
	transition: color 0.2s;
	text-align: center;
	width: 100%;
}

.cecc-continue-shopping-btn:hover {
	color: #332d27;
}

/* ==========================================================================
   10. CHECKOUT VIEW (STEP 2)
   ========================================================================== */
.cecc-checkout-view {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.cecc-checkout-top-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 12px;
	border-bottom: 1px solid #eae4dc;
}

.cecc-back-to-cart-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: none;
	font-size: 13px;
	font-weight: 600;
	color: #9a7041;
	cursor: pointer;
	padding: 0;
	transition: transform 0.2s;
}

.cecc-back-to-cart-btn:hover {
	transform: translateX(-3px);
}

.cecc-step-badge {
	font-size: 12px;
	font-weight: 600;
	color: #8c7f72;
	background: #f1ede7;
	padding: 4px 8px;
	border-radius: 4px;
}

.cecc-checkout-errors {
	padding: 12px 15px;
	background-color: #fdf2f2;
	border-left: 4px solid #e53e3e;
	color: #c53030;
	font-size: 13px;
	border-radius: 4px;
	line-height: 1.4;
}

.cecc-form-section {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.cecc-checkout-section-title {
	font-size: 15px;
	font-weight: 700;
	color: #332d27;
	margin: 10px 0 6px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cecc-form-grid {
	display: grid;
	gap: 12px;
}

.cecc-grid-2 {
	grid-template-columns: 1fr 1fr;
}

.cecc-form-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.cecc-form-field label {
	font-size: 13px;
	font-weight: 600;
	color: #4a4036;
}

.cecc-form-field label .required {
	color: #e53e3e;
}

.cecc-form-field input[type="text"],
.cecc-form-field input[type="tel"],
.cecc-form-field input[type="email"],
.cecc-form-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #dcd5cc;
	border-radius: 6px;
	font-size: 14px;
	color: #332d27;
	background-color: #ffffff;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.cecc-form-field input:focus,
.cecc-form-field textarea:focus {
	border-color: #9a7041;
	box-shadow: 0 0 0 3px rgba(154, 112, 65, 0.12);
}

.cecc-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #4a4036;
	cursor: pointer;
	margin: 10px 0;
}

.cecc-shipping-fields {
	margin-top: 10px;
	padding: 15px;
	background: #f8f6f3;
	border-radius: 6px;
	border: 1px solid #eae4dc;
}

/* Payment Gateways */
.cecc-gateways-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cecc-gateway-card {
	border: 1px solid #eae4dc;
	background-color: #ffffff;
	border-radius: 6px;
	padding: 12px 15px;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}

.cecc-gateway-card.active {
	border-color: #9a7041;
	background-color: #faf6f0;
}

.cecc-gateway-header {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 600;
	color: #332d27;
	cursor: pointer;
	margin: 0;
}

.cecc-gateway-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.cecc-gateway-description {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #eae4dc;
	font-size: 13px;
	color: #6b5f54;
	line-height: 1.4;
}

/* Checkout Footer & Live Total */
.cecc-checkout-footer {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid #eae4dc;
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.cecc-checkout-order-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 16px;
	font-weight: 600;
	color: #332d27;
}

.cecc-live-checkout-total {
	font-size: 22px;
	font-weight: 700;
	color: #9a7041;
}

/* ==========================================================================
   11. ORDER SUCCESS VIEW (STEP 3)
   ========================================================================== */
.cecc-order-success-view {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 20px 0;
}

.cecc-success-badge-icon {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background-color: #eafaf1;
	color: #27ae60;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	box-shadow: 0 6px 16px rgba(39, 174, 96, 0.15);
}

.cecc-success-title {
	font-size: 24px;
	font-weight: 700;
	color: #2e2620;
	margin: 0 0 8px;
	font-family: Georgia, serif;
}

.cecc-success-subtitle {
	font-size: 14px;
	color: #7a7066;
	margin: 0 0 24px;
}

.cecc-success-card {
	width: 100%;
	background-color: #ffffff;
	border: 1px solid #eae4dc;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-align: left;
}

.cecc-success-stat {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	color: #5c4e42;
}

.cecc-success-shipping {
	width: 100%;
	background: #f8f6f3;
	border-radius: 8px;
	padding: 15px 20px;
	margin-bottom: 25px;
	text-align: left;
}

.cecc-success-shipping h4 {
	font-size: 14px;
	font-weight: 700;
	color: #332d27;
	margin: 0 0 8px;
}

.cecc-success-shipping address {
	font-style: normal;
	font-size: 13px;
	color: #6b5f54;
	line-height: 1.4;
}

.cecc-success-phone {
	font-size: 13px;
	color: #9a7041;
	font-weight: 600;
	margin: 6px 0 0;
}

/* Spinner Animation */
.cecc-spinner {
	animation: cecc-rotate 1.5s linear infinite;
	width: 18px;
	height: 18px;
	margin-right: 8px;
	vertical-align: middle;
}

.cecc-spinner .path {
	stroke: #ffffff;
	stroke-linecap: round;
	animation: cecc-dash 1.5s ease-in-out infinite;
}

@keyframes cecc-rotate {
	100% {
		transform: rotate(360deg);
	}
}

@keyframes cecc-dash {
	0% {
		stroke-dasharray: 1, 150;
		stroke-dashoffset: 0;
	}
	50% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -35;
	}
	100% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -124;
	}
}

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */
@media (max-width: 600px) {
	.cecc-offcanvas-panel {
		max-width: 100% !important;
	}
	.cecc-offcanvas-header {
		padding: 15px 18px;
	}
	.cecc-offcanvas-body {
		padding: 15px 18px;
	}
	.cecc-grid-2 {
		grid-template-columns: 1fr;
	}
}
