
/* =========================================================
   SEEDHUB INDIA - CART PAGE
========================================================= */

:root {
    --cart-primary: #2f7d32;
    --cart-primary-dark: #256628;
    --cart-secondary: #f4f8f3;
    --cart-border: #e4e8e3;
    --cart-text: #222;
    --cart-muted: #777;
    --cart-white: #fff;
    --cart-danger: #dc3545;
    --cart-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    --cart-radius: 14px;
}

/* =========================================================
   PAGE
========================================================= */

.cart-page {
    background: #f8faf7;
    min-height: 70vh;
    color: var(--cart-text);
}

/* =========================================================
   COMMON CONTAINER
========================================================= */

.cart-container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

/* =========================================================
   CART HEADER
========================================================= */

.cart-header {
    background: linear-gradient(135deg, #eef7eb, #ffffff);
    padding: 65px 0 55px;
    border-bottom: 1px solid var(--cart-border);
}

.cart-header .cart-container {
    text-align: center;
}

.cart-label {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--cart-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cart-header h1 {
    margin: 0;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.15;
    font-weight: 700;
    color: #1d2b1e;
}

.cart-header p {
    margin: 14px 0 0;
    color: var(--cart-muted);
    font-size: 16px;
}

/* =========================================================
   CART CONTENT
========================================================= */

.cart-content {
    padding: 55px 0 80px;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 30px;
    align-items: start;
}

/* =========================================================
   CART ITEMS SECTION
========================================================= */

.cart-items-section {
    background: var(--cart-white);
    border: 1px solid var(--cart-border);
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
    overflow: hidden;
}

.cart-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 25px;
    border-bottom: 1px solid var(--cart-border);
}

.cart-items-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1e2a20;
}

.cart-items-header span {
    color: var(--cart-muted);
    font-size: 14px;
    font-weight: 500;
}

/* =========================================================
   CART ITEMS
========================================================= */

.cart-items {
    width: 100%;
}

.cart-item {
    display: grid;
    grid-template-columns: 90px minmax(150px, 1fr) auto auto 40px;
    align-items: center;
    gap: 20px;
    padding: 22px 25px;
    border-bottom: 1px solid var(--cart-border);
    transition: background 0.2s ease;
}

.cart-item:last-child {
    border-bottom: 0;
}

.cart-item:hover {
    background: #fbfdfb;
}

/* =========================================================
   PRODUCT IMAGE
========================================================= */

.cart-item-image {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f5f1;
    border: 1px solid var(--cart-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-image img[src=""] {
    display: none;
}

/* =========================================================
   PRODUCT DETAILS
========================================================= */

.cart-item-details {
    min-width: 0;
}

.cart-item-category {
    display: block;
    margin-bottom: 5px;
    color: var(--cart-primary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-item-details h3 {
    margin: 0 0 7px;
    color: #202820;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cart-item-details h3 span {
    margin-top: 5px;
    color: var(--cart-muted) !important;
    font-size: 12px !important;
    font-weight: 400;
}

.cart-item-price {
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

/* =========================================================
   QUANTITY CONTROL
========================================================= */

.cart-item-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9dfd7;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.cart-item-quantity button {
    width: 36px;
    height: 36px;
    border: 0;
    background: #f5f7f4;
    color: #333;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-item-quantity button:hover {
    background: var(--cart-primary);
    color: #fff;
}

.cart-item-quantity .quantity-value {
    min-width: 38px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

/* =========================================================
   ITEM TOTAL
========================================================= */

.cart-item-total {
    min-width: 90px;
    text-align: right;
    color: #202820;
    font-size: 16px;
    font-weight: 700;
}

/* =========================================================
   REMOVE BUTTON
========================================================= */

.cart-item-remove {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #fff1f2;
    color: var(--cart-danger);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-item-remove:hover {
    background: var(--cart-danger);
    color: #fff;
    transform: rotate(90deg);
}

/* =========================================================
   EMPTY CART
========================================================= */

.empty-cart {
    display: none;
    padding: 70px 30px;
    text-align: center;
}

.empty-cart-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #eef7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
}

.empty-cart h2 {
    margin: 0 0 10px;
    color: #222;
    font-size: 24px;
    font-weight: 700;
}

.empty-cart p {
    max-width: 420px;
    margin: 0 auto 25px;
    color: var(--cart-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* =========================================================
   CONTINUE SHOPPING BUTTON
========================================================= */

.continue-shopping-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 25px;
    border-radius: 8px;
    background: var(--cart-primary);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.continue-shopping-btn:hover {
    background: var(--cart-primary-dark);
    color: #fff;
    transform: translateY(-2px);
}

/* =========================================================
   CART SUMMARY
========================================================= */

.cart-summary {
    position: sticky;
    top: 25px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--cart-border);
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
}

.cart-summary h2 {
    margin: 0 0 25px;
    color: #202820;
    font-size: 22px;
    font-weight: 700;
}

/* =========================================================
   SUMMARY ROWS
========================================================= */

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
}

.summary-row span {
    color: #666;
    font-size: 15px;
}

.summary-row strong {
    color: #222;
    font-size: 15px;
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    margin: 15px 0;
    background: var(--cart-border);
}

/* =========================================================
   TOTAL
========================================================= */

.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0 22px;
}

.summary-total span {
    color: #222;
    font-size: 17px;
    font-weight: 600;
}

.summary-total strong {
    color: var(--cart-primary);
    font-size: 24px;
    font-weight: 750;
}

/* =========================================================
   CHECKOUT BUTTON
========================================================= */

.checkout-btn {
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    background: var(--cart-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.checkout-btn:hover {
    background: var(--cart-primary-dark);
    box-shadow: 0 8px 18px rgba(47, 125, 50, 0.2);
    transform: translateY(-2px);
}

.checkout-btn:active {
    transform: translateY(0);
}

/* =========================================================
   SUMMARY CONTINUE SHOPPING
========================================================= */

.continue-shopping {
    display: block;
    margin-top: 18px;
    color: #666;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.continue-shopping:hover {
    color: var(--cart-primary);
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 991px) {

    .cart-container {
        width: min(100% - 30px, 900px);
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 80px minmax(0, 1fr) auto;
        gap: 15px;
    }

    .cart-item-quantity {
        grid-column: 2;
        justify-self: start;
    }

    .cart-item-total {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .cart-item-remove {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }

    .cart-item-details {
        grid-column: 2;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .cart-header {
        padding: 45px 0 40px;
    }

    .cart-header h1 {
        font-size: 34px;
    }

    .cart-header p {
        font-size: 14px;
    }

    .cart-content {
        padding: 30px 0 50px;
    }

    .cart-container {
        width: min(100% - 24px, 600px);
    }

    .cart-items-header {
        padding: 18px;
    }

    .cart-items-header h2 {
        font-size: 19px;
    }

    .cart-items-header span {
        font-size: 13px;
    }

    .cart-item {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 12px;
        padding: 18px;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-item-details {
        grid-column: 2;
    }

    .cart-item-details h3 {
        font-size: 15px;
    }

    .cart-item-price {
        font-size: 13px;
    }

    .cart-item-quantity {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .cart-item-total {
        grid-column: 2;
        grid-row: 3;
        min-width: auto;
        text-align: left;
        font-size: 16px;
    }

    .cart-item-remove {
        grid-column: 2;
        grid-row: 3;
        justify-self: end;
    }

    .empty-cart {
        padding: 50px 20px;
    }

    .empty-cart h2 {
        font-size: 21px;
    }

    .empty-cart p {
        font-size: 14px;
    }

    .cart-summary {
        padding: 22px 18px;
    }

    .cart-summary h2 {
        font-size: 20px;
    }

    .summary-total strong {
        font-size: 21px;
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .cart-header h1 {
        font-size: 29px;
    }

    .cart-label {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .cart-item {
        padding: 15px;
    }

    .cart-item-image {
        width: 62px;
        height: 62px;
    }

    .cart-item-details h3 {
        font-size: 14px;
    }

    .cart-item-category {
        font-size: 10px;
    }

    .cart-item-quantity button {
        width: 32px;
        height: 32px;
    }

    .cart-item-quantity .quantity-value {
        min-width: 32px;
    }

    .checkout-btn {
        min-height: 48px;
        font-size: 14px;
    }
}

/* =========================================================
   ACCESSIBILITY
========================================================= */

.cart-page button:focus-visible,
.cart-page a:focus-visible {
    outline: 3px solid rgba(47, 125, 50, 0.3);
    outline-offset: 3px;
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .cart-page *,
    .cart-page *::before,
    .cart-page *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* =========================================================
   TAX — Cart summary row + per-item badge
   Added for tax_rule implementation.
========================================================= */

/* Tax info hint in the summary row (shows rate labels like "(5%, 18%)") */
.cart-tax-info {
    display: inline-block;
    font-size: 10px;
    color: var(--text-light, #888);
    margin-left: 4px;
    font-weight: 400;
}

/* Per-item tax badge shown beneath the unit price in each cart row */
.cart-item-tax-badge {
    display: inline-block;
    margin-top: 3px;
    padding: 1px 7px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.6;
}

/* Tax badge colour variants — shared with admin products list */
.tax-badge--none  { background: #f1f5f1; color: #6b7b6b; }
.tax-badge--low   { background: #fff7e0; color: #8a6000; }
.tax-badge--high  { background: #fef2f2; color: #b91c1c; }

/* Variant text inside cart item name */
.cart-item-variant {
    display: block;
    font-size: 12px;
    color: var(--text-light, #888);
    margin-top: 2px;
}

/* ── Mobile: tax badge stays readable at 375px ── */
@media (max-width: 480px) {
    .cart-item-tax-badge {
        font-size: 9px;
        padding: 1px 6px;
    }
    .cart-tax-info {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}
