/* ==========================================================================
   TERPLANDIA — SIDE CART DRAWER (Bright Theme)
   ========================================================================== */

/* ---- Floating Trigger ---- */
.terp-sc-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3ba89e, #2d8a82);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(59, 168, 158, 0.35);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.terp-sc-trigger:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 10px 30px rgba(59, 168, 158, 0.4);
}

.terp-sc-trigger svg {
    stroke: #fff;
}

.terp-sc-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #c9a84c;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}

/* ---- Overlay ---- */
.terp-sc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 27, 78, 0.25);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.terp-sc-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ---- Drawer ---- */
.terp-sc-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: #ffffff;
    box-shadow: -8px 0 40px rgba(45, 27, 78, 0.1);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: 'Outfit', sans-serif;
    color: #2d1b4e;
}

.terp-sc-drawer.active {
    right: 0;
}

@media (max-width: 768px) {
    .terp-sc-drawer {
        width: 85vw;
        right: -85vw;
    }

    .terp-sc-header {
        padding: 18px 18px 12px;
    }

    .terp-sc-body {
        padding: 12px 18px;
    }

    .terp-sc-footer {
        padding: 14px 18px 20px;
    }

    .terp-sc-shipping {
        padding: 10px 18px 12px;
    }

    .terp-sc-item-name {
        font-size: 0.82rem;
    }

    .terp-sc-item-price {
        font-size: 0.8rem;
    }

    /* Touch-friendly qty buttons */
    .terp-sc-qty {
        height: 36px;
    }

    .terp-sc-qty-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Touch-friendly remove button */
    .terp-sc-remove {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    /* Touch-friendly cross-sell add */
    .terp-sc-drawer .terp-sc-cross-add {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }
}

@media (max-width: 500px) {
    .terp-sc-drawer {
        width: 100%;
        right: -100%;
    }
}

/* ---- Loader ---- */
.terp-sc-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
}

.terp-sc-drawer.updating .terp-sc-loader {
    opacity: 1;
    visibility: visible;
}

.terp-sc-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(45, 27, 78, 0.1);
    border-top-color: #3ba89e;
    border-radius: 50%;
    animation: terp-sc-spin 0.7s linear infinite;
}

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

/* ---- Header ---- */
.terp-sc-header {
    padding: 24px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(45, 27, 78, 0.08);
}

/* Account for WP admin bar when logged in */
.admin-bar .terp-sc-drawer {
    top: 32px;
    height: calc(100% - 32px);
}

@media (max-width: 782px) {
    .admin-bar .terp-sc-drawer {
        top: 46px;
        height: calc(100% - 46px);
    }
}

.terp-sc-header h3 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d1b4e;
    letter-spacing: 0.02em;
}

.terp-sc-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #b8b0c8;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
}

.terp-sc-close:hover {
    color: #2d1b4e;
}

/* ---- Shipping Bar ---- */
.terp-sc-shipping {
    padding: 14px 24px 16px;
}

.terp-sc-shipping-msg {
    font-size: 0.8rem;
    color: #5a4a7a;
    margin-bottom: 8px;
}

.terp-sc-shipping-msg strong {
    color: #3ba89e;
}

.terp-sc-shipping-track {
    height: 6px;
    background: rgba(45, 27, 78, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.terp-sc-shipping-bar {
    height: 100%;
    background: linear-gradient(90deg, #3ba89e, #4ecdc4);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ---- Body (scrollable) ---- */
.terp-sc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.terp-sc-body::-webkit-scrollbar {
    width: 3px;
}

.terp-sc-body::-webkit-scrollbar-thumb {
    background: rgba(45, 27, 78, 0.1);
    border-radius: 3px;
}

/* ---- Cart Item ---- */
.terp-sc-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(45, 27, 78, 0.06);
    position: relative;
    align-items: center;
}

.terp-sc-item:last-of-type {
    border-bottom: none;
}

.terp-sc-item-img img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(45, 27, 78, 0.08);
}

.terp-sc-item-info {
    flex: 1;
    min-width: 0;
}

.terp-sc-item-name {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: #2d1b4e !important;
    text-decoration: none !important;
    margin-bottom: 2px;
    padding-right: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.terp-sc-item-name:hover {
    color: #c9a84c !important;
}
.terp-sc-item-variation {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.terp-sc-item-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3ba89e;
    margin-bottom: 8px;
}

/* ---- Quantity Controls ---- */
.terp-sc-qty {
    display: flex;
    align-items: center;
    background: #f7f5fb;
    border-radius: 20px;
    width: fit-content;
    height: 30px;
    border: 1px solid rgba(45, 27, 78, 0.08);
}

.terp-sc-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a4a7a;
    transition: all 0.2s;
}

.terp-sc-qty-btn:hover {
    color: #2d1b4e;
    background: rgba(45, 27, 78, 0.06);
}

.terp-sc-qty-minus { border-radius: 20px 0 0 20px; }
.terp-sc-qty-plus { border-radius: 0 20px 20px 0; }

.terp-sc-qty-val {
    width: 28px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2d1b4e;
}

/* ---- Remove Button ---- */
.terp-sc-remove {
    position: absolute;
    top: 14px;
    right: 0;
    background: none;
    border: none;
    font-size: 18px;
    color: #ccc;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.terp-sc-remove:hover {
    background: #fee2e2;
    color: #dc4545;
}

/* ---- Empty Cart ---- */
.terp-sc-empty {
    text-align: center;
    padding: 50px 20px;
}

.terp-sc-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.terp-sc-empty p {
    color: #5a4a7a;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* ---- Cross-Sells ---- */
.terp-sc-cross-sells {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(45, 27, 78, 0.08);
}

.terp-sc-cross-title {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2d1b4e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 12px;
}

.terp-sc-cross-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(45, 27, 78, 0.06);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.terp-sc-cross-item:hover {
    border-color: rgba(45, 27, 78, 0.12);
    box-shadow: 0 2px 10px rgba(45, 27, 78, 0.06);
}

.terp-sc-cross-thumb img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
}

.terp-sc-cross-info {
    flex: 1;
    min-width: 0;
}

.terp-sc-cross-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d1b4e !important;
    text-decoration: none !important;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.terp-sc-cross-name:hover {
    color: #c9a84c !important;
}

.terp-sc-cross-thumb {
    display: block;
    flex-shrink: 0;
}

.terp-sc-cross-meta {
    display: flex;
    gap: 4px;
    margin-bottom: 2px;
}

.terp-sc-cross-badge {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 999px;
}

.terp-sc-cross-badge--indica { background: rgba(107, 63, 196, 0.08); color: #6b3fc4; }
.terp-sc-cross-badge--sativa { background: rgba(26, 154, 110, 0.08); color: #1a9a6e; }
.terp-sc-cross-badge--hybrid { background: rgba(168, 138, 58, 0.1); color: #a88a3a; }
.terp-sc-cross-badge--terpene { background: rgba(59, 168, 158, 0.08); color: #3ba89e; }

.terp-sc-cross-price {
    font-size: 0.75rem;
    font-weight: 600;
    color: #3ba89e;
}

.terp-sc-drawer .terp-sc-cross-add {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #3ba89e !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #fff !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    min-width: 30px !important;
}

.terp-sc-drawer .terp-sc-cross-add svg {
    stroke: #fff !important;
}

.terp-sc-drawer .terp-sc-cross-add:hover {
    background: #2d8a82 !important;
    transform: scale(1.1);
}

.terp-sc-drawer .terp-sc-cross-add.terp-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ---- Footer ---- */
.terp-sc-footer {
    border-top: 1px solid rgba(45, 27, 78, 0.08);
    padding: 16px 24px 24px;
}

.terp-sc-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 1rem;
}

.terp-sc-subtotal span:first-child {
    font-weight: 500;
    color: #5a4a7a;
}

.terp-sc-subtotal-amount {
    font-weight: 700;
    color: #2d1b4e;
    font-size: 1.1rem;
}

.terp-sc-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terp-sc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.terp-sc-btn--primary {
    background: linear-gradient(135deg, #3ba89e, #2d8a82);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(59, 168, 158, 0.25);
}

.terp-sc-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 168, 158, 0.3);
}

.terp-sc-btn--outline {
    background: transparent;
    color: #2d1b4e !important;
    border: 1px solid rgba(45, 27, 78, 0.15);
}

.terp-sc-btn--outline:hover {
    background: #f7f5fb;
    border-color: rgba(45, 27, 78, 0.25);
}
