/* === OwwCommerce Frontend Modul: Components === */

/* ==============================================================
   TOAST NOTIFICATIONS
   ============================================================== */
.owwc-toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--owwc-space-sm);
    z-index: 10000;
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}

.owwc-toast {
    /* Surface terang + blur untuk toast */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 4px solid var(--owwc-primary);
    box-shadow: var(--owwc-shadow-lg);
    border-radius: var(--owwc-radius-sm);
    padding: 14px 20px;
    color: var(--owwc-text-main);
    font-size: var(--owwc-font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--owwc-space-sm);
    pointer-events: auto;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
    width: 100%;
}

.owwc-toast.owwc-show {
    transform: scale(1);
    opacity: 1;
}

.owwc-toast.success {
    border-left-color: var(--owwc-success);
}

.owwc-toast.error {
    border-left-color: var(--owwc-danger);
}

/* ==============================================================
   LOADING SKELETON
   ============================================================== */
.owwc-skeleton {
    /* Skeleton loading shimmer untuk light mode */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: owwc-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--owwc-radius-sm);
}

.owwc-skeleton--text {
    height: 14px;
    margin-bottom: 10px;
    width: 80%;
}

.owwc-skeleton--text-sm {
    height: 12px;
    margin-bottom: 8px;
    width: 60%;
}

.owwc-skeleton--box {
    height: 60px;
    width: 100%;
}

.owwc-skeleton--circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

@keyframes owwc-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

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

/* ==============================================================
   BREADCRUMB
   ============================================================== */
.owwc-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--owwc-space-sm);
    font-size: var(--owwc-font-size-sm);
    color: var(--owwc-text-muted);
    margin-bottom: var(--owwc-space-lg);
    flex-wrap: wrap;
}

.owwc-breadcrumb a {
    color: var(--owwc-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.owwc-breadcrumb a:hover {
    color: var(--owwc-primary);
}

.owwc-breadcrumb .owwc-breadcrumb-sep {
    color: var(--owwc-text-light);
    user-select: none;
}

.owwc-breadcrumb .owwc-breadcrumb-current {
    color: var(--owwc-text-main);
    font-weight: 500;
}

/* ==============================================================
   FLOATING CART
   ============================================================== */
.owwc-floating-cart-wrapper {
    position: fixed;
    z-index: 9999;
    background: var(--owwc-surface);
    box-shadow: var(--owwc-shadow-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--owwc-transition-bounce);
}

/* Sembunyikan jika di halaman My Account atau Checkout */
.owwc-my-account-page .owwc-floating-cart-wrapper,
.owwc-checkout-page .owwc-floating-cart-wrapper {
    display: none !important;
}

.owwc-floating-cart-wrapper:hover {
    transform: scale(1.08) translateY(-3px);
}

.owwc-floating-cart-wrapper .owwc-cart-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--owwc-text-main) !important;
    text-decoration: none;
}

/* Posisi */
.owwc-floating-cart-wrapper.bottom-right {
    bottom: 28px;
    right: 28px;
}

.owwc-floating-cart-wrapper.bottom-left {
    bottom: 28px;
    left: 28px;
}

.owwc-floating-cart-wrapper.top-right {
    top: 28px;
    right: 28px;
}

.owwc-floating-cart-wrapper.top-left {
    top: 28px;
    left: 28px;
}

/* Varian style */
.owwc-floating-cart-wrapper.style-1 {
    border-radius: 50%;
    padding: 14px;
}

.owwc-floating-cart-wrapper.style-2 {
    border-radius: var(--owwc-radius-lg);
    padding: 14px;
}

.owwc-floating-cart-wrapper.style-3 {
    border-radius: var(--owwc-radius-full);
    padding: 14px 24px;
}

.owwc-floating-cart-wrapper.style-3 .owwc-cart-icon-link::after {
    content: "Keranjang";
    margin-left: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--owwc-text-main);
}

.owwc-shop-hero .owwc-breadcrumb {
    justify-content: center;
    margin-bottom: 10px;
    opacity: 0.8;
}

.owwc-shop-hero .owwc-breadcrumb a,
.owwc-shop-hero .owwc-breadcrumb .owwc-breadcrumb-current,
.owwc-shop-hero .owwc-breadcrumb .owwc-breadcrumb-sep {
    color: #fff !important;
}

/* Styling Single Product dipindahkan secara modular ke single-product.css */

/* --- UI Refactor: Merged Inline CSS --- */
/* Cart Badge */
.owwc-cart-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 5px;
}

.owwc-cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--owwc-primary, #4F46E5);
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.owwc-cart-icon-link:hover .owwc-cart-badge {
    transform: scale(1.1);
}

/* Cart Skeleton Loader */
.owwc-skeleton-cart-row {
    height: 80px;
    margin-bottom: 12px;
}

/* --- Coupon Section --- */
.owwc-coupon-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dotted var(--owwc-border);
}

.owwc-coupon-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.owwc-coupon-input {
    margin-bottom: 0 !important;
    flex: 1;
    height: 40px;
    padding: 8px 12px;
    font-size: 13px;
}

.owwc-coupon-btn {
    height: 40px;
    padding: 0 16px !important;
    font-size: 13px !important;
    white-space: nowrap;
    background: #111;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--owwc-transition);
}

.owwc-coupon-btn:hover {
    background: var(--owwc-primary);
}

.owwc-coupon-msg {
    font-size: 12px;
    margin-top: 5px;
    display: none;
}