/* =====================================================
   MINI CART NOTIFICATION STYLES — CLEAN FINAL VERSION
   ===================================================== */

/* ===== CART CONTAINER ===== */
.cart-notification {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-notification.active {
    right: 0;
}

/* ===== OVERLAY ===== */
.cart-notification__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1;
}

.cart-notification.active .cart-notification__overlay {
    opacity: 1;
    visibility: visible;
}

/* ===== CART CONTENT ===== */
.cart-notification__content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 2;
}

/* ===== CART HEADER ===== */
.cart-title {
    display: flex;
    align-items: center;
    padding: 25px 70px 25px 30px;
    border-bottom: 1px solid #e5e5e5;
    background: #f3e9e0;
    position: relative;
    z-index: 10;
    flex: 0 0 auto;
}

.cart-title h4 {
    font-weight: 500;
    margin: 0;
    color: #232323;
    font-family: 'Marcellus', serif;
    font-size: 18px;
}

/* ===== CART COUNT BADGE ===== */
#miniCartcount.cart-count {
    margin-left: 12px;
    background: #232323;
    text-transform: uppercase;
    font-size: 11px;
    padding: 6px 14px;
    color: #fff !important;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

#miniCartcount .cart-count-number,
#miniCartcount .cart-label {
    font-weight: 700;
    color: #fff !important;
    display: inline;
}

/* ===== CLOSE BUTTON ===== */
.cart-close-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    color: #232323;
    transition: all 0.3s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.cart-close-icon:hover {
    opacity: 0.7;
    transform: translateY(-50%) rotate(90deg);
}

/* ===== PROGRESS DIVIDER ===== */
.mini-cart-progress {
    height: 1px;
    background: #e5e5e5;
    flex: 0 0 auto;
}

/* ===== FREE SHIPPING GOAL ===== */
.cart-goal {
    padding: 20px 30px;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
    flex: 0 0 auto;
    overflow: visible;
}

.cart-goal-msg {
    font-size: 13px;
    color: #555;
    margin-bottom: 18px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}

.cart-goal-msg span {
    font-weight: 700;
    color: #232323;
}

.cart-goal__inner {
    position: relative;
    padding-top: 13px;
    padding-bottom: 13px;
    overflow: visible;
}

.cart-goal__bar {
    background-color: #e5e5e5;
    height: 6px;
    border-radius: 10px;
    position: relative;
    overflow: visible;
    width: 100%;
}

.cart-goal__bar > span {
    background-image: linear-gradient(90deg, #ff7800 0%, #ffcd06 100%);
    border-radius: 10px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: block;
    height: 6px;
    width: 0%;
    max-width: 100%;
    overflow: visible;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-goal__bar .goal-badge {
    position: absolute;
    top: 3px; /* vertically center on the 6px bar */
    transform: translate(-50%, -50%);
    background-color: #232323;
    color: #fff;
    padding: 0 8px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    min-width: 40px;
    height: 22px;
    white-space: nowrap;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-goal__bar .goal-badge::after {
    content: '%';
    margin-left: 1px;
}

/* ===== CONFETTI ===== */
#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: 0;
    will-change: transform, opacity;
}

@keyframes confettiFall {
    0%   { transform: translateY(-10px) translateX(0) rotate(0deg); opacity: 1; }
    25%  { opacity: 1; }
    50%  { opacity: 0.9; }
    75%  { opacity: 0.6; }
    100% { transform: translateY(calc(100vh + 20px)) translateX(var(--drift)) rotate(720deg); opacity: 0; }
}

/* ===== SCROLLABLE ITEMS AREA ===== */
.mini-cart-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* critical for Safari flex shrink */
    padding: 0;
}

.mini-cart-wrapper::-webkit-scrollbar       { width: 5px; }
.mini-cart-wrapper::-webkit-scrollbar-track { background: #f5f5f5; }
.mini-cart-wrapper::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 10px; }
.mini-cart-wrapper::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }

/* ===== CART ITEMS ===== */
.cart-notification-products {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-notification-product {
    display: flex;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e5e5;
    gap: 15px;
    transition: background 0.2s;
}

.cart-notification-product:hover { background: #fafafa; }

.cart-notification-product .product-image {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
}

.cart-notification-product .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cart-notification-product:hover .product-image img { transform: scale(1.05); }

.cart-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-inner {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.product-name {
    font-size: 16px;
    font-weight: 500;
    color: #232323;
    text-decoration: none;
    line-height: 1.5;
    margin-right: 10px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
}

.product-name:hover { color: #c09671; }

.remove {
    flex-shrink: 0;
    color: #999;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    transition: color 0.2s;
}

.remove:hover { color: #232323; }

.quantity-wrap {
    display: flex;
    align-items: center;
    margin-top: auto;
    gap: 15px;
}

.amount {
    font-size: 14px;
    font-weight: 500;
    color: #232323;
    flex: 1;
    font-family: 'Inter', sans-serif;
}

.quantity {
    display: flex;
    align-items: center;
    border: 2px solid #e9d6c6;
    background: #fff;
}

.quantity-minus,
.quantity-plus {
    width: 32px;
    height: 32px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-minus:hover:not(:disabled),
.quantity-plus:hover:not(:disabled) {
    color: #232323;
    background: #fafafa;
}

.quantity-minus:disabled,
.quantity-plus:disabled { opacity: 0.3; cursor: not-allowed; }

.quantity-input {
    width: 40px;
    height: 32px;
    border: none;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    color: #232323;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    font-family: 'Inter', sans-serif;
    padding: 0;
    line-height: 32px;
}

.quantity-input:focus { outline: none; }
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== EMPTY CART ===== */
.cart-empty {
    text-align: center;
    padding: 60px 30px;
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cart-notification.cart-is-empty .cart-empty { display: flex !important; }

.cart-empty i {
    font-size: 50px;
    color: #322e2a;
    margin-bottom: 20px;
    display: block;
}

.cart-empty h6 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #232323;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Marcellus', serif;
}

.cart-empty .btn-hongo {
    padding: 14px 30px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-family: 'Inter', sans-serif;
    background: #232323;
    color: #fff;
    border: 2px solid #232323;
}

.cart-empty .btn-hongo:hover { background: #fff; color: #232323; }

/* Hide sections when empty */
.cart-notification.cart-is-empty #miniCartcount,
.cart-notification.cart-is-empty .cart-goal,
.cart-notification.cart-is-empty .cart-notification-ymal,
.cart-notification.cart-is-empty .mini-cart-bottom { display: none !important; }

.cart-notification.cart-is-empty .mini-cart-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== YOU MAY ALSO LIKE ===== */
.cart-notification-ymal {
    padding: 25px 20px;
    background: #f9f1ea;
    border-top: 1px solid #e5e5e5;
    display: none;
}

.cart-notification:not(.cart-is-empty) .cart-notification-ymal { display: block; }

.ymal-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    color: #232323;
    text-align: center;
    font-family: 'Marcellus', serif;
}

.ymal-swiper {
    width: 100%;
    padding-bottom: 35px;
    overflow: hidden;
}

.ymal-swiper .swiper-pagination { bottom: 0 !important; }

.ymal-swiper .swiper-pagination-bullet {
    background: #232323;
    opacity: 0.3;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    transition: all 0.3s;
}

.ymal-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    width: 20px;
    border-radius: 4px;
}

.ymal-product {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 12px;
    transition: all 0.3s;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
}

.ymal-product:hover {
    border-color: #232323;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ymal-product img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    margin-bottom: 12px;
    flex-shrink: 0;
    border-radius: 2px;
    transition: transform 0.3s;
}

.ymal-product:hover img { transform: scale(1.05); }

.ymal-product-title {
    font-size: 13px;
    font-weight: 500;
    color: #232323;
    margin-bottom: 8px;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
    min-height: 36px;
}

.ymal-product-price {
    font-size: 15px;
    font-weight: 600;
    color: #232323;
    font-family: 'Inter', sans-serif;
    margin-top: auto;
}

/* ===== CART BOTTOM (pinned) ===== */
.mini-cart-bottom {
    flex: 0 0 auto;
    border-top: 1px solid #e5e5e5;
    background: #f3e9e0;
    position: relative;
    z-index: 5;
    width: 100%;
}

/* ===== ADDONS ===== */
.cart-notification-addons {
    padding: 0 30px;
    background: #f3e9e0;
}

.addon-icon {
    display: flex;
    justify-content: space-between;
}

.addon-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 8px;
    border: 0 !important;
    border-right: 1px solid #e9d6c6 !important;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px !important;
    color: #322e2a;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.addon-btn:last-child { border-right: 0 !important; }
.addon-btn:hover { color: #232323; background: rgba(0, 0, 0, 0.05); }
.addon-btn.active { background: #232323; color: #fff; }

.addon-btn i {
    font-size: 20px;
    margin-bottom: 8px;
    color: #232323;
    display: block;
}

.addon-btn.active i { color: #fff; }

.addon-content {
    display: none;
    padding: 20px 0 0;
    animation: slideDown 0.3s ease;
}

.addon-content.active { display: block; }

.addon-content .popup-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 12px;
    font-weight: 600;
    color: #232323;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}

.addon-content .popup-icon i { font-size: 18px; }

.addon-content textarea,
.addon-content input[type="text"],
.addon-content select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e5e5e5;
    border-radius: 0;
    font-size: 13px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    color: #232323;
    background: #fff;
}

.addon-content textarea:focus,
.addon-content input:focus,
.addon-content select:focus { outline: none; border-color: #232323; }

.addon-content .field { margin-bottom: 15px; }

.addon-content .field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #232323;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.addon-action {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.btn-save {
    padding: 14px 20px;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    background: #232323;
    color: #fff;
}

.btn-save:hover { background: #000; }

.btn-cancel {
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.btn-cancel:hover { color: #232323; }

/* ===== TOTALS ===== */
.cart-notification-totals {
    padding: 15px 30px 0;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-subtotal label { margin: 0; }

.cart-subtotal-amount {
    font-size: 20px;
    font-family: 'Inter', sans-serif;
}

/* ===== TERMS AGREEMENT ===== */
.cart-agreement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 30px;
    font-size: 14px;
    color: #666;
    background: #f3e9e0;
    font-family: 'Inter', sans-serif;
}

.cart-agreement input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cart-agreement label { margin: 0; line-height: 1.6; cursor: pointer; }
.cart-agreement a { color: #232323; text-decoration: underline; font-weight: 600; }
.cart-agreement a:hover { color: #c09671; }

/* ===== ACTION BUTTONS ===== */
.cart-notification-buttons {
    padding: 10px 30px 15px;
    display: flex;
    flex-direction: column;
}

.cart-notification-buttons .btn-hongo,
.cart-notification-buttons a {
    padding: 16px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 0;
    text-align: center;
    transition: all 0.3s;
    text-decoration: none;
    border: 2px solid #232323;
    display: block;
    font-family: 'Inter', sans-serif;
}

.btn-hongo-black,
#mini-cart-checkout {
    background: #232323;
    color: #fff !important;
}

.btn-hongo-black:hover:not(:disabled),
#mini-cart-checkout:hover:not(:disabled) { background: #fff; color: #232323 !important; }

.btn-hongo-black:disabled,
#mini-cart-checkout:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-hongo-outline { background: transparent; color: #232323; }
.btn-hongo-outline:hover { background: #232323; color: #fff; }

/* ===== MISC ===== */
#shipping-estimate { margin-top: 15px; }

.shipping-result { padding: 15px; border-radius: 4px; font-size: 14px; }

.gift-options label { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 15px; }
.gift-options input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

#gift-message {
    width: 100%;
    min-height: 80px;
    padding: 12px 15px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    resize: vertical;
}

#gift-wrap-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px dashed #e5e5e5;
    margin-top: 10px;
}

.mini-cart-loading { opacity: 0.6; pointer-events: none; }

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ===== BODY SCROLL LOCK ===== */
/* Do NOT use position:fixed — it breaks flex layout inside the drawer on mobile */
body.cart-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .cart-notification { max-width: 100%; }

    .cart-title { padding: 15px 60px 15px 20px; }
    .cart-title h4 { font-size: 16px; }

    #miniCartcount.cart-count { font-size: 10px; padding: 5px 10px; margin-left: 10px; }

    .cart-goal { padding: 16px 20px; }
    .cart-goal__bar .goal-badge { min-width: 36px; height: 20px; font-size: 10px; padding: 0 6px; }

    .cart-notification-product { padding: 15px 15px; }
    .cart-notification-product .product-image { width: 75px; height: 75px; }

    .cart-notification-addons,
    .cart-notification-totals { padding-left: 15px; padding-right: 15px; }

    .cart-notification-buttons { padding: 2px 20px 20px; }

    .cart-notification-ymal { padding: 20px 15px; }
    .ymal-product img { height: 120px; }
}

@media (max-width: 360px) {
    .cart-goal { padding: 14px 15px; }
    .cart-goal__bar .goal-badge { min-width: 32px; height: 18px; font-size: 10px; padding: 0 5px; }

    .cart-notification-product .product-image { width: 70px; height: 70px; }
    .product-name { font-size: 14px; }
    .amount { font-size: 13px; }

    .quantity-minus, .quantity-plus { width: 28px; height: 28px; font-size: 14px; }
    .quantity-input { width: 35px; height: 28px; }

    .ymal-product img { height: 100px; }
}