/* ==============================================
   CART STYLES - ABAK MARKET
   ============================================== */

:root {
    --cart-primary: #008946;
    /* Light green */
    --cart-primary-dark: #003919;
    --cart-bg: #ffffff;
    --cart-shadow: 0 10px 40px rgba(23, 36, 27, 0.15);
    --cart-radius: 24px;
    --cart-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --cart-font: 'Inter', sans-serif;
}

/* Floating Cart Button */
.cart-float-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--cart-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(139, 195, 74, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: var(--cart-transition);
    border: none;
    outline: none;
}

.cart-float-btn:hover {
    background: var(--cart-primary-dark);
    color: #ffffff;
}

.cart-float-btn .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

/* ── Cart Overlay/Drawer ──
   Main styles live in components.css.
   Only supplemental styles belong here.
   (Legacy !important overrides removed – they broke the flex layout.)
*/


/* Old .cart-header / .cart-close / .cart-items / .cart-footer:
   now handled by components.css via .cart-drawer__* classes.
*/


.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f5f5f5;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin: 0 0 5px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--cart-font);
    color: #2C1810;
}

.cart-item-price {
    color: var(--cart-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.qty-btn:hover {
    background: #f0f0f0;
}

.cart-item-qty {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    margin-left: auto;
    color: #e74c3c;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Old .cart-footer / .cart-total / .cart-whatsapp-btn:
   handled by .cart-drawer__footer, .cart-total-row, .btn-whatsapp.
*/


/* Empty Cart */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.cart-empty i {
    font-size: 4rem;
    margin-bottom: 15px;
}

/* Add to Cart Button on Product Card */
.add-to-cart-btn {
    background: var(--cart-primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--cart-transition);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.2);
}

.add-to-cart-btn:hover {
    transform: scale(1.1);
    background: var(--cart-primary-dark);
    color: #ffffff;
}

.add-to-cart-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile: handled by components.css responsive */


/* Delivery Block in Cart */
.cart-delivery-block {
    margin-bottom: 12px;
}

.cart-fill-btn {
    width: 100%;
    padding: 13px 16px;
    background: #ffffff;
    color: #003919;
    border: 1.5px dashed #008946;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
}

.cart-fill-btn:hover {
    background: rgba(0, 137, 70, 0.1);
    border-color: #008946;
}

.cart-whatsapp-btn:disabled {
    cursor: not-allowed;
}

/* ── Compliance block overlay ── */
.product-card {
    position: relative;
}

.compliance-block-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    border-radius: 0 0 12px 12px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

.compliance-reason {
    color: #ff6b6b;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 1 — Weight Bar
═══════════════════════════════════════════════════════════════ */
.cart-weight-section {
    background: var(--clr-surface, #f8f8f8);
    border-radius: 14px;
    padding: 12px 14px !important;
    margin-bottom: 0;
}

.weight-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.weight-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--clr-text, #333);
}

.weight-bar-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--clr-accent, #25d366);
    font-variant-numeric: tabular-nums;
}

.weight-bar-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.weight-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #008946, rgba(0, 137, 70, 0.5));
    border-radius: 99px;
    transition: width 0.5s ease;
}

.weight-bar-fill--over {
    background: linear-gradient(90deg, #ff6b6b, #d63031);
    animation: pulse-red 1.2s ease infinite;
}

@keyframes pulse-red {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.weight-bar-hint {
    font-size: 11px;
    margin-top: 5px;
    color: var(--clr-text-mid, #888);
}

.weight-bar-hint--warn {
    color: #e67e22;
    font-weight: 600;
}

.weight-bar-hint--error {
    color: #e74c3c;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 1 — Limits Grid
═══════════════════════════════════════════════════════════════ */
.limits-badge {
    font-size: 14px;
    margin-left: 4px;
}

.limit-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.limit-item {
    background: var(--clr-surface, #f8f8f8);
    border-radius: 10px;
    padding: 9px 12px;
    border: 1.5px solid transparent;
}

.limit-item--over {
    border-color: #ff6b6b;
    background: rgba(231, 76, 60, 0.05);
}

.limit-item__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.limit-item__title {
    font-size: 12px;
    color: var(--clr-text-mid, #666);
    font-weight: 500;
}

.limit-item__count {
    font-size: 12px;
    font-weight: 700;
    color: var(--clr-accent, #25d366);
    font-variant-numeric: tabular-nums;
}

.limit-item__count--err {
    color: #e74c3c;
}

.limit-bar-track {
    height: 5px;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 99px;
    overflow: hidden;
}

.limit-bar-fill {
    height: 100%;
    background: var(--cart-primary);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.limit-bar-fill--over {
    background: #e74c3c;
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 1 — Cart Item badges
═══════════════════════════════════════════════════════════════ */
.cart-item__meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 3px 0 4px;
}

.item-weight-note {
    font-size: 10px;
    color: var(--clr-accent, #25d366);
    background: rgba(37, 211, 102, 0.1);
    padding: 1px 6px;
    border-radius: 99px;
    font-weight: 600;
}

.item-rule-badge {
    font-size: 10px;
    color: #666;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 6px;
    border-radius: 99px;
    font-weight: 600;
    font-family: monospace;
}

.item-rule-badge--warn {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 1 — Validation Errors (human-readable)
═══════════════════════════════════════════════════════════════ */
.cart-validation-errors {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.val-error-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(231, 76, 60, 0.07);
    border-left: 3px solid #e74c3c;
}

.val-error-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.val-error-body {
    flex: 1;
}

.val-error-text {
    font-size: 13px;
    font-weight: 600;
    color: #c0392b;
    line-height: 1.3;
}

.val-error-fix {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
    line-height: 1.4;
}

.val-warn-item {
    padding: 8px 12px;
    font-size: 12px;
    background: rgba(243, 156, 18, 0.08);
    border-left: 3px solid #f39c12;
    color: #856404;
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 1 — Rules Accept Checkbox
═══════════════════════════════════════════════════════════════ */
.rules-accept-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    color: var(--clr-text, #333);
    cursor: pointer;
    line-height: 1.4;
}

.rules-accept-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox-styled {
    width: 22px;
    height: 22px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 10px;
    flex-shrink: 0;
}

.rules-accept-label input:checked ~ .custom-checkbox-styled {
    background-color: var(--cart-primary);
    border-color: var(--cart-primary);
}

.custom-checkbox-styled::after {
    content: "";
    display: none;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.rules-accept-label input:checked ~ .custom-checkbox-styled::after {
    display: block;
}

.rules-link {
    color: var(--clr-accent, #25d366);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.2s;
}

.rules-link:hover {
    text-decoration-color: currentColor;
}

.cart-orders-link {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--clr-text-mid, #888);
    text-decoration: none;
    margin-top: 10px;
    padding: 6px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    transition: color 0.2s;
}

.cart-orders-link:hover {
    color: var(--clr-accent, #25d366);
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 1 — Rules Modal
═══════════════════════════════════════════════════════════════ */
.rules-inline-content {
    animation: fadeIn 0.3s ease;
}

.rules-inline-content h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--clr-accent, #25d366);
    margin: 8px 0 6px;
    text-transform: uppercase;
}

.rules-inline-content ul {
    padding-left: 18px;
    margin: 0 0 10px 0;
}

.rules-inline-content li {
    font-size: 12px;
    color: var(--clr-text, #333);
    margin-bottom: 4px;
    line-height: 1.4;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 2 — Prison Warnings banner (Rule 8)
═══════════════════════════════════════════════════════════════ */
.cart-prison-warnings {
    background: rgba(243, 156, 18, 0.07);
    border-left: 3px solid #f39c12;
    border-radius: 12px;
    padding: 12px 14px !important;
}

.prison-warn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.prison-warn-icon {
    font-size: 16px;
}

.prison-warn-title {
    font-size: 13px;
    font-weight: 700;
    color: #856404;
}

.prison-warn-name {
    font-size: 12px;
    color: #555;
    font-weight: 600;
    margin-bottom: 6px;
}

.prison-warn-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prison-warn-item {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.prison-warn-item b {
    color: #c07a00;
}