/* ─── GC Cart ───────────────────────────────────────────────────────────────── */

/* Floating icon */
#gc-cart-icon {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9998;
    display: none; /* shown via JS when cart not empty */
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2c7be5;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    border: none;
    transition: transform .18s ease, box-shadow .18s ease;
}
#gc-cart-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(0,0,0,.28);
}
#gc-cart-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
/* Принудительно перебиваем стили темы для SVG внутри иконки */
#gc-cart-icon svg,
#gc-cart-icon svg path,
#gc-cart-icon svg circle,
#gc-cart-icon svg polyline,
#gc-cart-icon svg line {
    fill: none !important;
    stroke: #fff !important;
}
.gc-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e84141;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* Overlay */
#gc-cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .22s ease;
}
#gc-cart-overlay.gc-cart-open {
    display: block;
    opacity: 1;
}

/* Drawer */
#gc-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    width: 380px;
    max-width: 100vw;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 32px rgba(0,0,0,.14);
}
#gc-cart-overlay.gc-cart-open #gc-cart-drawer {
    transform: translateX(0);
}

/* Header */
.gc-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.gc-cart-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}
#gc-cart-close {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: #888;
    font-size: 22px;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: color .15s;
    box-shadow: none !important;
}
#gc-cart-close:hover,
#gc-cart-close:focus,
#gc-cart-close:active {
    color: #1a1a1a;
    box-shadow: none !important;
    background: none !important;
}

/* List */
#gc-cart-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}
.gc-cart-empty {
    color: #999;
    text-align: center;
    margin-top: 48px;
    font-size: 15px;
}

/* Item row */
.gc-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.gc-cart-item:last-child { border-bottom: none; }
.gc-cart-item__img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f0f0f0;
    display: block;
}
.gc-cart-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* чтобы длинный title не распирал flex */
}
.gc-cart-item__title {
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.gc-cart-item__price {
    font-size: 14px;
}
.gc-cart-item__price-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.gc-cart-old-price {
    text-decoration: line-through;
    color: #bbb;
    font-size: 12px;
    font-weight: 400;
}
.gc-cart-price {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a1a;
}
.gc-cart-price--sale {
    color: #e84141;
}
.gc-cart-discount-badge {
    display: inline-block;
    background: #e84141;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
}
.gc-cart-item__remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color .15s;
}
.gc-cart-item__remove:hover { color: #e84141; }

/* Footer */
.gc-cart-footer {
    padding: 16px 20px 24px;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#gc-cart-total {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: right;
}

/* Email section */
#gc-cart-email-section {
    display: none;
}
.gc-cart-email-label {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}
.gc-cart-email-row {
    display: flex;
    gap: 8px;
}
#gc-cart-email {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
#gc-cart-email:focus { border-color: #2c7be5; }
#gc-cart-email-submit {
    padding: 9px 16px;
    background: #2c7be5 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
#gc-cart-email-submit:hover,
#gc-cart-email-submit:focus,
#gc-cart-email-submit:active {
    background: #1a68cc !important;
    box-shadow: none !important;
    color: #fff !important;
}

/* Promo note */
.gc-cart-promo-note {
    font-size: 11px;
    color: #aaa;
    text-align: center;
}

/* Checkout button */
#gc-cart-checkout-btn {
    width: 100%;
    padding: 13px;
    background: #2c7be5 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background .15s;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
#gc-cart-checkout-btn:hover:not(:disabled),
#gc-cart-checkout-btn:focus:not(:disabled),
#gc-cart-checkout-btn:active:not(:disabled) {
    background: #1a68cc !important;
    box-shadow: none !important;
    color: #fff !important;
}
#gc-cart-checkout-btn:disabled {
    background: #b0c8ef !important;
    cursor: default;
    box-shadow: none !important;
}

/* Messages */
.gc-cart-msg {
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}
.gc-cart-msg--error { color: #e84141; }
.gc-cart-msg--ok    { color: #22a06b; }

/* Иконки кнопок через ::before — data URI не подвержена переопределению темой */
.gc-cart-button::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 6px;
    flex-shrink: 0;
    background-size: 15px 15px;
    background-repeat: no-repeat;
    background-position: center;
    /* иконка корзины */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
}
/* Состояние «уже в корзине» — иконка галочки */
.gc-cart-button--added::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* Add to cart buttons (in cards) */
.gc-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #2c7be5 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    outline: none;
}
.gc-cart-button:hover,
.gc-cart-button:focus,
.gc-cart-button:active {
    background: #1a68cc !important;
    box-shadow: none !important;
    color: #fff !important;
}
.gc-cart-button--added,
.gc-cart-button--added:hover,
.gc-cart-button--added:focus,
.gc-cart-button--added:active {
    background: #22a06b !important;
    box-shadow: none !important;
    color: #fff !important;
}
.gc-cart-button--added:hover { background: #1a8a5a !important; }

/* Mobile */
@media (max-width: 480px) {
    #gc-cart-drawer {
        width: 100vw;
    }
    #gc-cart-icon {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* ─── Bulk discount message ──────────────────────────────────────────────── */

.gc-cart-bulk-msg {
    display: none;
    font-size: 14px;
    border-radius: 0;
    padding: 10px 20px;
    text-align: center;
    flex-shrink: 0;
}

.gc-cart-bulk-msg--hint {
    display: block;
    background: #fff3cd;
    color: #5c3d00;
    border-bottom: 2px solid #ffc107;
    font-weight: 600;
    font-size: 14px;
}

.gc-cart-bulk-msg--active {
    display: block;
    background: #e8f5e9;
    color: #1b5e20;
    border-bottom: 1px solid #a5d6a7;
    font-size: 15px;
    font-weight: 700;
}

/* Итого со скидкой */
.gc-cart-total-old {
    text-decoration: line-through;
    color: #aaa;
    font-weight: 400;
    margin-right: 6px;
    font-size: 14px;
}

.gc-cart-savings {
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
    color: #555;
}

.gc-cart-savings span {
    color: #2a9d5c;
    font-weight: 600;
}
