/* ============================================================
   COLORFUL TEMPLATE - Modern Multi-Theme Toko Template
   Based on color scheme from template.php design reference
   ============================================================ */

/* ---------- CSS VARIABLES (Theme System) ---------- */
:root, body.theme-default {
    --primary-color: #0d6efd;
    --primary-rgb: 13, 110, 253;
    --secondary-color: #f8f9fa;
    --text-color: #212529;
    --text-muted: #6c757d;
    --header-bg: #ffffff;
    --nav-bg: #0d6efd;
    --nav-text: #ffffff;
    --footer-bg: #f8f9fa;
    --btn-primary: #0d6efd;
    --btn-primary-hover: #0b5ed7;
    --bottom-nav-active: #0d6efd;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.05);
    --card-hover-shadow: 0 5px 15px rgba(0,0,0,0.1);
    --section-title-color: var(--primary-color);
    --badge-bg: #dc3545;
}

body.theme-ocean {
    --primary-color: #0077b6;
    --primary-rgb: 0, 119, 182;
    --secondary-color: #e0fbfc;
    --text-color: #03045e;
    --header-bg: #ffffff;
    --nav-bg: #0077b6;
    --nav-text: #ffffff;
    --footer-bg: #caf0f8;
    --btn-primary: #0077b6;
    --btn-primary-hover: #00b4d8;
    --bottom-nav-active: #0077b6;
    --section-title-color: #0077b6;
}

body.theme-forest {
    --primary-color: #2b9348;
    --primary-rgb: 43, 147, 72;
    --secondary-color: #e9f5db;
    --text-color: #004b23;
    --header-bg: #ffffff;
    --nav-bg: #2b9348;
    --nav-text: #ffffff;
    --footer-bg: #d8f3dc;
    --btn-primary: #2b9348;
    --btn-primary-hover: #55a630;
    --bottom-nav-active: #2b9348;
    --section-title-color: #2b9348;
}

body.theme-sunset {
    --primary-color: #e85d04;
    --primary-rgb: 232, 93, 4;
    --secondary-color: #ffecd1;
    --text-color: #370617;
    --header-bg: #ffffff;
    --nav-bg: #e85d04;
    --nav-text: #ffffff;
    --footer-bg: #ffddb0;
    --btn-primary: #e85d04;
    --btn-primary-hover: #f48c06;
    --bottom-nav-active: #e85d04;
    --section-title-color: #e85d04;
}

body.theme-midnight {
    --primary-color: #7b2cbf;
    --primary-rgb: 123, 44, 191;
    --secondary-color: #f3d5fe;
    --text-color: #10002b;
    --header-bg: #ffffff;
    --nav-bg: #7b2cbf;
    --nav-text: #ffffff;
    --footer-bg: #e0aaff;
    --btn-primary: #7b2cbf;
    --btn-primary-hover: #9d4edd;
    --bottom-nav-active: #7b2cbf;
    --section-title-color: #7b2cbf;
}

/* ---------- GLOBAL ---------- */
html, body {
    height: 100%;

}
body {
    background: #d2d2d2;
    color: var(--text-color);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
}
@media (min-width: 768px) {
    body { padding-bottom: 0; }
}

.text-custom-primary { color: var(--primary-color); }
.btn-custom-primary {
    background: var(--btn-primary);
    border-color: var(--btn-primary);
    color: #fff;
}
.btn-custom-primary:hover {
    background: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: #fff;
}
.btn-outline-custom-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.btn-outline-custom-primary:hover {
    background: var(--primary-color);
    color: #fff;
}

.section-title-custom {
    color: var(--section-title-color);
}

/* ---------- TOP HEADER ---------- */
.top-header {
    background: var(--header-bg);
    border-bottom: 1px solid #eee;
}
.btn-search-outline {
    border: 1px solid #dee2e6;
    color: #6c757d;
    background: #fff;
}
.btn-search-outline:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

/* ---------- MAIN NAVIGATION ---------- */
.main-nav {
    background: var(--nav-bg);
}
.main-nav .nav-link {
    color: var(--nav-text) !important;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background 0.2s;
}
.main-nav .nav-link:hover {
    background: rgba(255,255,255,0.15);
}
.main-nav .nav-link i {
    margin-right: 6px;
}
/* ---------- DROPDOWN SUBMENU (Desktop) ---------- */
.dropdown-submenu {
    position: relative;
}
.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 2px;
    border-radius: 10px;
}
.dropdown-submenu > .dropdown-toggle::after {
    transform: rotate(-90deg);
}
@media (min-width: 992px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }
    .main-nav .dropdown-menu {
        padding: 8px;
        min-width: 200px;
    }
    .main-nav .dropdown-item {
        border-radius: 8px;
        padding: 8px 14px;
        font-size: 0.9rem;
        transition: background 0.15s;
    }
    .main-nav .dropdown-item:hover {
        background: rgba(var(--primary-rgb), 0.08);
        color: var(--primary-color);
    }
    .main-nav .dropdown-submenu > .dropdown-menu {
        margin-left: 0;
    }
}

@media (max-width: 991.98px) {
    .main-nav .offcanvas-lg {
        background-color: var(--header-bg);
    }
    .main-nav .offcanvas-lg .nav-link,
    .main-nav .offcanvas-lg .nav-text {
        color: var(--text-color) !important;
    }
}

/* ---------- PRODUCT CARD ---------- */
.product-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}
.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f9fa;
}
.product-img-wrapper a {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    padding: 12px;
}
.product-card:hover .product-img-wrapper img {
    transform: scale(1.05);
}
.product-title {
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
}

/* ---------- CART TABLE ---------- */
.cart-table {
    background: #fff;
    box-shadow: var(--card-shadow);
}
.cart-table thead th {
    background: var(--secondary-color);
    border-bottom: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.cart-table .qtybtn {
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.cart-table .qtybtn:active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ---------- CART SUMMARY ---------- */
.cart-summary-card {
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}
.cart-summary-card .card-header {
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
}

/* ---------- BREADCRUMB ---------- */
.breadcrumb-custom .breadcrumb {
    background: transparent;
    padding: 0;
}
.breadcrumb-custom .breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}
.breadcrumb-custom .breadcrumb-item.active {
    color: var(--text-muted);
}

/* ---------- BOTTOM NAV (Mobile) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1030;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
}
.bottom-nav-item {
    text-align: center;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: color 0.2s;
}
.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}
.bottom-nav-item.active {
    color: var(--bottom-nav-active);
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
}

/* ---------- OFF-CANVAS MOBILE MENU ---------- */
@media (max-width: 991.98px) {
    .main-nav .offcanvas-lg {
        background-color: var(--header-bg);
    }
    .main-nav .offcanvas-lg .nav-link,
    .main-nav .offcanvas-lg .nav-text {
        color: var(--text-color) !important;
    }
    /* Hide shop link on mobile */
    .main-nav .offcanvas-lg .nav-shop {
        display: none !important;
    }
    /* Category tree on mobile */
    .cat-toggle {
        cursor: pointer;
        user-select: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .cat-toggle i {
        transition: transform 0.2s;
        font-size: 0.75rem;
    }
    .cat-toggle[aria-expanded="true"] i {
        transform: rotate(180deg);
    }
    .cat-toggle-btn i {
        transition: transform 0.2s;
    }
    .cat-toggle-btn[aria-expanded="true"] i {
        transform: rotate(180deg);
    }
    .cat-sub-list {
        list-style: none;
        padding-left: 1.25rem !important;
        margin: 0;
    }
    .cat-sub-list .nav-link {
        font-size: 0.9rem;
        padding: 6px 14px !important;
    }
    /* Override Bootstrap collapse animation for smoother expand */
    .cat-sub-list.collapsing {
        transition: height 0.2s ease;
    }
}

/* ---------- CART NOTIFICATION TOAST ---------- */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.35s ease;
    border-left: 4px solid #28a745;
}
.cart-notification.show {
    transform: translateX(0);
}
.cart-notification h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
}

/* ---------- FOOTER ---------- */
footer {
    background: var(--footer-bg);
    font-size: 0.9rem;
    margin-top: auto;
    flex-shrink: 0;
}
footer .fr-view p { margin-bottom: 4px; }
footer a { color: var(--primary-color); }
.footer-links li { margin-bottom: 6px; }
.footer-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.88rem;
    transition: color 0.15s, padding-left 0.15s;
    display: inline-block;
}
.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 3px;
}
.market-icon {
    display: inline-block;
    transition: transform 0.2s;
}
.market-icon:hover {
    transform: translateY(-2px);
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--btn-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    text-align: center;
    line-height: 44px;
    font-size: 1.2rem;
    transition: all 0.2s;
}
.back-to-top:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-3px);
}

@media (min-width: 768px) {
    .back-to-top { bottom: 30px; }
}

/* ---------- UTILITY ---------- */
.bg-soft-primary {
    background-color: rgba(var(--primary-rgb), 0.06);
}

.rounded-10 {
    border-radius: 10px;
}

.transition-all {
    transition: all 0.2s ease;
}

/* ---------- MOBILE CART (TikTok-style) ---------- */
.cart-item-mobile {
    position: relative;
    background: #fff;
    transition: background 0.2s;
}
.cart-item-mobile:active {
    background: #f8f9fa;
}
.qtybtn-mobile {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.8rem;
    border-radius: 50% !important;
    transition: all 0.15s;
}
.qtybtn-mobile:active {
    transform: scale(0.9);
}

/* Mobile sticky bottom bar */
.cart-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

/* Desktop sidebar sticky */
.cart-summary-card {
    position: sticky;
    top: 90px;
}

/* Spacer so sticky bar doesn't overlap content */
.pb-7 {
    padding-bottom: 5rem !important;
}
@media (min-width: 768px) {
    .pb-7 {
        padding-bottom: 5rem !important;
    }
}
@media (max-width: 767.98px) {
    .pb-7 {
        padding-bottom: 8rem !important;
    }
}

/* Stok habis background */
.bg-danger-subtle {
    background-color: #fce4e4;
}

/* Kupon collapse on mobile */
#mobileKupon .card {
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

/* Coupon input height match button */
form[action=""] .input-group input[name="kupon"] {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    height: auto;
}

/* Coupon form inside mobile sticky bar */
.cart-sticky-bottom #mobileKupon .card {
    margin-bottom: 0;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.85rem;
}
.cart-sticky-bottom #mobileKupon .input-group {
    flex-wrap: nowrap;
}
.cart-sticky-bottom #mobileKupon input[name="kupon"] {
    font-size: 0.85rem;
}
.cart-sticky-bottom #mobileKupon input[value="Apply Coupon"],
.cart-sticky-bottom #mobileKupon .btn {
    font-size: 0.85rem;
    white-space: nowrap;
}
.cart-sticky-bottom #mobileKupon .bg-light {
    padding: 0.5rem 0.75rem !important;
}

/* ===== Payment Method Cards ===== */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.payment-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    overflow: hidden;
}
.payment-card:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.03);
}
.payment-card.selected {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.06);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
.payment-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.payment-card-left {
    flex-shrink: 0;
}
.payment-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.payment-card.selected .payment-card-icon {
    background: var(--primary-color);
    color: #fff;
}
.payment-card-body {
    flex: 1;
    min-width: 0;
}
.payment-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
}
.payment-card-fee {
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 1px;
}
.payment-card-check {
    flex-shrink: 0;
    font-size: 1.2rem;
    color: #dee2e6;
    transition: color 0.2s ease;
}
.payment-card.selected .payment-card-check {
    color: var(--primary-color);
}

/* ===== Checkout Sticky Bottom Bar (mobile) ===== */
.checkout-sticky-bottom .checkout-sticky-detail {
    line-height: 1.4;
    font-size: 0.78rem;
}
.checkout-sticky-bottom .checkout-sticky-detail span {
    white-space: nowrap;
}

/* ===== Address Suggestion Dropdown ===== */
#suggestions {
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    background: #fff;
    width: calc(100% - 2px);
    z-index: 1000;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#suggestions div {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}
#suggestions div:last-child {
    border-bottom: none;
}
#suggestions div:hover {
    background: rgba(var(--primary-rgb), 0.06);
}
/* ============================================================
   PRODUCT DETAIL DESKTOP
   Deskripsi produk jangan terlalu lebar
   ============================================================ */

@media (min-width: 1200px) {

    .fr-view {
        max-width: 1000px;
        margin: 0 auto;
    }

}