/**
 * Shany Floating Cart Styles
 * Drawer slides from LEFT side (RTL)
 * Cart items use theme styles (card-product classes)
 */

:root {
    --sfc-drawer-width: 480px;
    --sfc-bg-color: #ffffff;
    --sfc-overlay-color: rgba(0, 0, 0, 0.5);
    --sfc-primary-color: #a2947a;
    --sfc-text-color: #333333;
    --sfc-border-color: #e5e5e5;
    --sfc-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main container - covers entire screen */
.shany-floating-cart {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    pointer-events: none;
    visibility: hidden;
}

.shany-floating-cart.open,
.shany-floating-cart.closing {
    pointer-events: auto;
    visibility: visible;
}

.shany-floating-cart.closing {
    pointer-events: none;
}

/* Dark overlay behind drawer */
.sfc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--sfc-overlay-color);
    opacity: 0;
    transition: opacity var(--sfc-transition);
}

.shany-floating-cart.open .sfc-overlay {
    opacity: 1;
}

.shany-floating-cart.closing .sfc-overlay {
    opacity: 0;
}

/* Drawer panel - slides from LEFT */
.sfc-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sfc-drawer-width);
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background-color: var(--sfc-bg-color);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform var(--sfc-transition);
    direction: rtl;
    overflow: hidden;
}

.shany-floating-cart.open .sfc-drawer {
    transform: translateX(0);
}

.shany-floating-cart.closing .sfc-drawer {
    transform: translateX(-100%);
}

/* Info Section - delivery info text */
.sfc-info {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 100%);
    border-bottom: 1px solid var(--sfc-border-color);
}

.sfc-info-image {
    display: none;
}

.sfc-info-texts {
    flex: 1;
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.sfc-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.sfc-info-title {
    font-family: 'Nathan', sans-serif;
    font-size: 36px;
    font-weight: 400;
    color: var(--sfc-primary-color);
    line-height: 1;
}

.sfc-info-text {
    font-size: 11px;
    color: #666;
    margin: 0;
    line-height: 1.3;
}

/* Background image for drawer */
.sfc-drawer::before {
    content: '';
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 280px;
    background-image: url('https://staging.shanybakeryonline.co.il/wp-content/uploads/2024/07/image-cart.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.sfc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--sfc-border-color);
    background-color: var(--sfc-bg-color);
    flex-shrink: 0;
}

.sfc-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--sfc-text-color);
}

.sfc-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--sfc-text-color);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.sfc-close:hover {
    background-color: #f5f5f5;
}

/* Scrollable content area */
.sfc-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    background-color: transparent;
    position: relative;
    z-index: 1;
}

/* Items list - use theme's cart-top__list class, override margin */
.sfc-content .cart-top__list {
    margin-top: 0;
}

/* Fixed pixel sizing for cart items (override theme's vw units) */
.shany-floating-cart .card-product {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 15px;
}

.shany-floating-cart .card-product__image {
    width: 156px;
    flex-shrink: 0;
}

.shany-floating-cart .card-product__image .img {
    width: 100%;
    padding-top: 132.5%;
    position: relative;
    border: 1px solid #D6D0B3;
    overflow: hidden;
}

.shany-floating-cart .card-product__image .img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shany-floating-cart .card-product__text {
    flex-grow: 1;
    padding: 20px 15px 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: transparent;
}

.shany-floating-cart .card-product__text > a {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 8px;
    color: #000;
}

.shany-floating-cart .card-product__text > a:hover {
    color: #a2947a;
    text-decoration: underline;
}

.shany-floating-cart .card-product .card-product__control {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 15px;
    margin-top: auto;
    margin-bottom: 0;
    width: 100%;
}

.shany-floating-cart .card-product__control .price {
    font-size: 18px;
    font-weight: 400;
    color: #000;
}

.shany-floating-cart .card-product__control .quantity-block {
    width: 100%;
}

.shany-floating-cart .card-product__control .quantity {
    width: 100%;
    display: flex;
    align-items: center;
    height: 40px;
}

.shany-floating-cart .card-product__control .quantity > div {
    width: calc(100% / 3);
    height: 100%;
    border: 1px solid #D6D0B3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}

.shany-floating-cart .card-product__control .quantity .quantity-wrap {
    cursor: default;
}

.shany-floating-cart .card-product__control .quantity input {
    width: 100%;
    height: 100%;
    text-align: center;
    border: none;
    font-size: 14px;
    background: transparent;
}

.shany-floating-cart .cart-item__delete {
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(147, 147, 147, 0.17);
    border: 1px solid rgba(147, 147, 147, 0.17);
}

/* Empty cart message */
.sfc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    color: #999;
}

.sfc-empty p {
    font-size: 16px;
    margin: 0;
}

/* Footer with total and checkout */
.sfc-footer {
    padding: 20px 25px;
    background-color: var(--sfc-bg-color);
    border-top: 1px solid var(--sfc-border-color);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.sfc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.sfc-total span:first-child {
    color: var(--sfc-text-color);
}

.sfc-total-amount {
    font-weight: 700;
    color: var(--sfc-text-color);
    font-size: 20px;
}

/* Checkout button */
.sfc-checkout-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background-color: var(--sfc-primary-color);
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.sfc-checkout-btn:hover {
    background-color: #8b7d65;
    color: white;
}

/* Loading state */
.sfc-content.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.sfc-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--sfc-border-color);
    border-top-color: var(--sfc-primary-color);
    border-radius: 50%;
    animation: sfc-spin 0.8s linear infinite;
}

@keyframes sfc-spin {
    to { transform: rotate(360deg); }
}

/* Mobile - hide floating cart, use theme's cart instead */
@media screen and (max-width: 768px) {
    .shany-floating-cart {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.sfc-open {
        overflow: auto !important;
    }
}

/* Hide body scroll when cart is open */
body.sfc-open {
    overflow: hidden;
}

/* Item removal animation */
.sfc-item.removing {
    animation: sfc-remove 0.3s ease forwards;
}

@keyframes sfc-remove {
    to {
        opacity: 0;
        transform: translateX(-20px);
        height: 0;
        padding: 0;
        margin: 0;
    }
}

/* Custom scrollbar */
.sfc-content::-webkit-scrollbar {
    width: 6px;
}

.sfc-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sfc-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sfc-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
