/* ============ ROOT ============ */
:root {
    --rc-orange: #1b3c53; /* nuansa shopee */
    --rc-orange-dark: #ee4d2d;
    --rc-text: #222;
    --rc-muted: rgba(255, 255, 255, 0.85);
    --rc-border: rgba(255, 255, 255, 0.25);
}

/* Wrapper utama */
.rc-header {
    width: 100%;
    background: var(--rc-orange);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}
.rc-header.is-inner {
    /* kalau halaman selain home ingin beda, bisa ubah di sini */
}
.rc-header.is-stuck {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.rc-header.is-compact .rc-mainbar {
    padding: 8px 0;
}
.rc-header.is-compact .rc-brand__logo img {
    max-height: 52px;
}
.rc-header.is-compact .rc-searchbar {
    height: 36px;
}
.rc-header.is-compact .rc-searchbar__btn {
    height: 36px;
}

/* Smooth transition untuk elements di dalam header */
.rc-mainbar {
    transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-brand__logo img {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-searchbar {
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-searchbar__btn {
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ TOPBAR ============ */
.rc-topbar {
    font-size: 12px;
    line-height: 1;
    border-bottom: 1px solid var(--rc-border);
}
.rc-topbar__inner {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.rc-topbar__left,
.rc-topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.rc-topbar__link {
    color: var(--rc-muted);
    text-decoration: none;
    white-space: nowrap;
}
.rc-topbar__link:hover {
    color: #fff;
    text-decoration: underline;
}
.rc-topbar__link--bold {
    color: #fff;
    font-weight: 600;
}
.rc-topbar__text {
    color: var(--rc-muted);
    white-space: nowrap;
}
.rc-topbar__sep {
    width: 1px;
    height: 14px;
    background: var(--rc-border);
}

/* Social placeholder (ganti pakai background-image kalau mau) */
.rc-topbar__social {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rc-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.rc-social i {
    font-size: 14px;
    color: #fff;
}
.rc-social:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* ============ MAINBAR ============ */
.rc-mainbar {
    padding: 14px 0;
    transition: padding 0.3s ease;
}
.rc-mainbar__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
}

/* Logo */
.rc-brand__logo img {
    max-height: 64px;
    width: auto;
    display: block;
    transition: max-height 0.3s ease;
}
/* Logo mobile hidden by default */
.rc-brand__logo .rc-logo-mobile {
    display: none;
}
/* Logo desktop hidden by default on mobile */
.rc-brand__logo .rc-logo-desktop {
    display: block;
}

/* Search */
.rc-search {
    min-width: 0;
}
.rc-searchbar {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 2px;
    overflow: hidden;
    height: 40px;
    transition: height 0.3s ease;
}
.rc-searchbar__input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 0 12px;
    font-size: 14px;
    color: var(--rc-text);
}
.rc-searchbar__btn {
    width: 56px;
    height: 40px;
    border: 0;
    background: var(--rc-orange-dark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: height 0.3s ease;
}
.rc-searchbar__btn:hover {
    filter: brightness(1.05);
}

/* Suggestion */
.rc-search__suggest {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}
.rc-search__suggest a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}
.rc-search__suggest a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Actions */
.rc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rc-action {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.rc-action--cart {
    font-size: 18px;
    position: relative;
    color: #fff;
    padding: 6px 8px;
}
/* Pastikan hover untuk cart tetap putih (global a:hover mengubah warna link menjadi #FFA633) */
.rc-action--cart:hover {
    color: #ee4d2d;
}
.rc-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #fff;
    display: none; /* nyalakan kalau ada item */
}

/* User */
.rc-action--user {
    padding: 6px 8px;
    border-radius: 4px;
}
.rc-action--user:hover {
    background: rgba(255, 255, 255, 0.1);
}
.rc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.rc-user__name {
    font-size: 13px;
    font-weight: 600;
}

/* Auth buttons */
.rc-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rc-auth__btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
}
.rc-auth__btn--ghost {
    background: transparent;
}
.rc-auth__btn--solid {
    background: rgba(255, 255, 255, 0.15);
}

/* Dropdown menu align */
.rc-user-menu {
    min-width: 220px;
}

/* Topbar User Info */
.rc-topbar__user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
}
.rc-topbar__user:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.rc-topbar__user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    object-fit: cover;
}
.rc-topbar__user-name {
    font-size: 12px;
    font-weight: 600;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991px) {
    /* Topbar responsive */
    .rc-topbar {
        font-size: 11px;
    }
    .rc-topbar__inner {
        height: auto;
        padding: 6px 0;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
    }
    .rc-topbar__left {
        flex: 1 1 auto;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .rc-topbar__left::-webkit-scrollbar {
        display: none;
    }
    .rc-topbar__right {
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 8px;
    }
    .rc-topbar__link {
        font-size: 11px;
    }
    .rc-topbar__sep {
        height: 12px;
    }

    /* Mainbar layout - single row */
    .rc-mainbar {
        padding: 10px 0;
    }
    .rc-mainbar__inner {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Logo sizing */
    .rc-brand {
        flex-shrink: 0;
    }
    .rc-brand__logo .rc-logo-desktop {
        display: none;
    }
    .rc-brand__logo .rc-logo-mobile {
        display: block;
        max-height: 40px;
        width: auto;
    }

    /* Search takes available space */
    .rc-search {
        flex: 1;
        min-width: 0;
    }
    .rc-searchbar {
        height: 36px;
    }
    .rc-searchbar__input {
        font-size: 13px;
        padding: 0 10px;
    }
    .rc-searchbar__btn {
        width: 46px;
        height: 36px;
    }

    /* Actions compact */
    .rc-actions {
        flex-shrink: 0;
        gap: 8px;
    }
    .rc-action--cart {
        padding: 4px 6px;
        font-size: 16px;
    }
    .rc-action--cart svg {
        width: 20px;
        height: 20px;
    }

    /* Hide user name on mobile */
    .rc-user__name {
        display: none;
    }
    .rc-action--user {
        padding: 4px 6px;
    }
    .rc-avatar {
        width: 24px;
        height: 24px;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575px) {
    /* Topbar extra small */
    .rc-topbar {
        font-size: 10px;
        padding: 4px 0;
    }
    .rc-topbar__inner {
        padding: 3px 6px;
        gap: 6px;
        height: 28px;
        align-items: center;
    }
    .rc-topbar__left {
        gap: 6px;
    }
    .rc-topbar__right {
        gap: 6px;
    }
    .rc-topbar__link {
        font-size: 11px;
        padding: 2px 6px;
    }
    .rc-topbar__text {
        display: none; /* Hide "Ikuti kami di" text on very small screens */
    }
    .rc-topbar__social {
        gap: 6px;
    }
    .rc-social {
        width: 22px;
        height: 22px;
        border-radius: 4px;
    }
    .rc-social i {
        font-size: 12px;
    }
    .rc-topbar__user-avatar {
        width: 18px;
        height: 18px;
    }
    .rc-topbar__user-name {
        font-size: 10px;
    }

    /* Mainbar extra small */
    .rc-mainbar__inner {
        gap: 8px;
    }
    .rc-brand__logo .rc-logo-mobile {
        max-height: 32px;
    }
    .rc-searchbar {
        height: 32px;
    }
    .rc-searchbar__input {
        font-size: 12px;
        padding: 0 8px;
    }
    .rc-searchbar__btn {
        width: 40px;
        height: 32px;
    }
}

/* ============ CART DROPDOWN & ANIMATION ============ */

/* Cart Wrapper */
.rc-cart-wrapper {
    position: relative;
}

/* Badge Styling */
.rc-action--cart .rc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--rc-orange-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Cart Badge Animation - SHAKE */
@keyframes cartShake {
    0%,
    100% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(15deg);
    }
    20% {
        transform: rotate(-15deg);
    }
    30% {
        transform: rotate(10deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(5deg);
    }
    60% {
        transform: rotate(-5deg);
    }
    70% {
        transform: rotate(2deg);
    }
    80% {
        transform: rotate(-2deg);
    }
}

.rc-action--cart.shake .rc-badge {
    animation: cartShake 0.6s ease-in-out;
}

/* Cart Badge Animation - BOUNCE */
@keyframes cartBounce {
    0%,
    100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.1);
    }
}

.rc-action--cart.bounce .rc-badge {
    animation: cartBounce 0.5s ease-in-out;
}

/* Cart Badge Animation - PULSE */
@keyframes cartPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(238, 77, 45, 0.7);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 10px rgba(238, 77, 45, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(238, 77, 45, 0);
    }
}

.rc-action--cart.pulse .rc-badge {
    animation: cartPulse 0.6s ease-in-out;
}

/* Cart Dropdown */
.rc-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    margin-top: 15px;
}

.rc-cart-wrapper:hover .rc-cart-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cart Dropdown Header */
.rc-cart-dropdown__header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px 12px 0 0;
}

.rc-cart-dropdown__header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--rc-text);
}

.rc-cart-count {
    font-size: 13px;
    color: var(--rc-orange-dark);
    font-weight: 600;
    background: rgba(238, 77, 45, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Cart Dropdown Body */
.rc-cart-dropdown__body {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

/* Cart Empty State */
.rc-cart-empty {
    padding: 40px 20px;
    text-align: center;
    color: #777;
}

.rc-cart-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 12px;
    display: block;
}

.rc-cart-empty p {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin: 0 0 4px 0;
}

.rc-cart-empty small {
    font-size: 12px;
    color: #999;
}

/* Cart Item */
.rc-cart-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    transition: background 0.2s ease;
}

.rc-cart-item:hover {
    background: #fafafa;
}

.rc-cart-item__img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-cart-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rc-cart-item__info {
    flex: 1;
    min-width: 0;
}

.rc-cart-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--rc-text);
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rc-cart-item__meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
}

.rc-cart-item__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--rc-orange-dark);
}

.rc-cart-item__remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rc-cart-item__remove:hover {
    background: rgba(238, 77, 45, 0.1);
    color: var(--rc-orange-dark);
}

/* Cart Dropdown Footer */
.rc-cart-dropdown__footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.rc-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.rc-cart-total span:first-child {
    font-weight: 600;
    color: #555;
}

.rc-cart-total-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--rc-orange-dark);
}

/* Scrollbar for cart dropdown */
.rc-cart-dropdown__body::-webkit-scrollbar {
    width: 6px;
}

.rc-cart-dropdown__body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.rc-cart-dropdown__body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.rc-cart-dropdown__body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 575px) {
    .rc-cart-dropdown {
        width: 300px;
        right: -10px;
    }

    .rc-cart-item__img {
        width: 50px;
        height: 50px;
    }
}
