/* =========================================================
   GLOBAL RESET — CART ONLY
========================================================= */

.cart-page,
.cart-page *,
.cart-hero,
.cart-hero * {
    box-sizing: border-box;
}

.cart-page {
    width: 100%;
    margin: 0;
    padding: 0 0 80px;
    color: var(--cart-text, #302320);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cart-page button,
.cart-page input {
    font-family: inherit;
}

/* =========================================================
   CONTAINER
========================================================= */

.cart-page > .container,
.cart-hero > .container {
    width: min(calc(100% - 40px), 1400px);
    margin: 0 auto;
}

/* =========================================================
   CART HERO
========================================================= */

.cart-hero {
    padding: 36px 0 30px;
    background: linear-gradient(180deg, #fffdfb 0%, #fcf9f6 100%);
}

.cart-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--cart-light-text, #8f7e76);
    font-size: 13px;
    font-weight: 500;
}

.cart-breadcrumb a {
    color: var(--cart-muted, #756862);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cart-breadcrumb a:hover {
    color: var(--cart-accent, #a52f3f);
}

.cart-breadcrumb span {
    color: #c5b8b1;
}

.cart-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.cart-eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #b34b2d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 3px;
    line-height: 1;
    text-transform: uppercase;
}

.cart-eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    flex: 0 0 26px;
    background: #b34b2d;
    border-radius: 999px;
}

.cart-heading h1 {
    margin: 0;
    color: #342724;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.1;
    font-weight: 750;
    letter-spacing: -1.2px;
}

.cart-heading p {
    max-width: 650px;
    margin: 12px 0 0;
    color: var(--cart-muted, #756862);
    font-size: 15px;
    line-height: 1.6;
}

.cart-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--cart-border, #ebdcd5);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--cart-muted, #756862);
    white-space: nowrap;
    box-shadow: 0 8px 25px rgba(72, 39, 27, 0.05);
}

.cart-count-badge strong {
    color: var(--cart-accent, #a52f3f);
    font-size: 15px;
    font-weight: 800;
}

.cart-count-badge span {
    font-size: 13px;
}

/* =========================================================
   CART LAYOUT
========================================================= */

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
    gap: 32px;
    padding-top: 10px;
}

.cart-items-section {
    min-width: 0;
}

.cart-section-header,
.cart-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.cart-section-header h2,
.cart-items-header h2 {
    margin: 0;
    color: var(--cart-text, #342724);
    font-size: 24px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.cart-clear-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--cart-border, #ebdcd5);
    border-radius: 10px;
    background: #ffffff;
    color: var(--cart-muted, #756862);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-clear-button:hover {
    color: var(--cart-accent, #a52f3f);
    border-color: #d9bdb2;
    background: #fff8f5;
    transform: translateY(-1px);
}

/* =========================================================
   CART ITEMS LIST & CARD
========================================================= */

.cart-items {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--cart-border, #ebdcd5);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(70, 35, 20, 0.04);
}

.cart-item {
    position: relative;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--cart-border-light, #f4eae4);
    transition: background 0.2s ease;
}

.cart-item:last-child {
    border-bottom: 0;
}

.cart-item:hover {
    background: #fffdfc;
}

/* Image */
.cart-item-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid #ead8ce;
    border-radius: 16px;
    background: #f8eee8;
}

.cart-item-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cart-item:hover .cart-item-image img {
    transform: scale(1.03);
}

.cart-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #a52f3f;
    font-size: 28px;
    font-weight: 800;
    background: #faede6;
}

/* Info */
.cart-item-info {
    min-width: 0;
}

.cart-item-info h3 {
    margin: 0 0 6px;
    color: #302320;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 750;
    letter-spacing: -0.3px;
}

.cart-item-weight {
    margin-bottom: 6px;
    color: var(--cart-muted, #756862);
    font-size: 13px;
}

.cart-item-price {
    color: var(--cart-accent, #a52f3f);
    font-size: 16px;
    font-weight: 800;
}

/* Quantity */
.cart-item-quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    overflow: hidden;
    border: 1px solid #e5d4cb;
    border-radius: 12px;
    background: #ffffff;
}

.cart-item-quantity .quantity-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 40px;
    flex: 0 0 38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cart-accent, #a52f3f);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cart-item-quantity .quantity-button:hover {
    background: #fff4ef;
}

.cart-item-quantity .quantity-input {
    appearance: textfield;
    -moz-appearance: textfield;
    width: 44px;
    height: 40px;
    flex: 0 0 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #332723;
    text-align: center;
    font-size: 14px;
    font-weight: 750;
}

.cart-item-quantity .quantity-input::-webkit-outer-spin-button,
.cart-item-quantity .quantity-input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

/* Total & Remove */
.cart-item-total {
    min-width: 90px;
    color: #302320;
    font-size: 17px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.cart-remove-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #ead6cf;
    border-radius: 10px;
    background: #fff9f7;
    color: #a43a48;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-remove-button:hover {
    border-color: #a43a48;
    background: #a43a48;
    color: #ffffff;
}

/* =========================================================
   ORDER SUMMARY
========================================================= */

.cart-summary {
    position: sticky;
    top: 24px;
    min-width: 0;
}

.cart-summary-card {
    padding: 30px;
    background: linear-gradient(145deg, #ffffff 0%, #fffaf7 100%);
    border: 1px solid var(--cart-border, #ebdcd5);
    border-radius: 22px;
    box-shadow: 0 15px 45px rgba(70, 35, 20, 0.06);
}

.cart-summary-card h2 {
    margin: 0 0 24px;
    color: #3a2925;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    color: #756862;
    font-size: 14px;
}

.summary-row strong {
    color: #342724;
    font-size: 15px;
    font-weight: 750;
}

.summary-divider {
    width: 100%;
    height: 1px;
    margin: 16px 0;
    background: var(--cart-border, #ebdcd5);
}

.summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-top: 4px;
}

.summary-total span {
    color: #342724;
    font-size: 16px;
    font-weight: 750;
}

.summary-total strong {
    color: var(--cart-accent, #a52f3f);
    font-size: 24px;
    font-weight: 850;
    letter-spacing: -0.5px;
}

.cart-checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 24px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #a52f3f 0%, #872636 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(150, 40, 55, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(150, 40, 55, 0.26);
}

.continue-shopping {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
}

.continue-shopping a,
a.continue-shopping {
    color: #8d3e2e;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.continue-shopping a:hover,
a.continue-shopping:hover {
    color: var(--cart-accent, #a52f3f);
    transform: translateX(-2px);
}

/* =========================================================
   EMPTY CART
========================================================= */

.empty-cart {
    padding: 60px 24px;
    background: #ffffff;
    border: 1px solid var(--cart-border, #ebdcd5);
    border-radius: 22px;
    text-align: center;
}

.empty-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #f8eee8;
    color: var(--cart-accent, #a52f3f);
    font-size: 28px;
}

.empty-cart h2 {
    margin: 0 0 10px;
    color: #30221f;
    font-size: 24px;
    font-weight: 750;
}

.empty-cart p {
    max-width: 480px;
    margin: 0 auto 24px;
    color: var(--cart-muted, #756862);
    font-size: 14px;
    line-height: 1.6;
}

.cart-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a52f3f, #872636);
    color: #ffffff;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

/* =========================================================
   RESPONSIVE MEDIA QUERIES (FIXES ALL SCREEN BREAKS)
========================================================= */

/* Tablets & Small Laptops (Max 1024px) */
@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .cart-summary {
        position: static;
    }
}

/* Tablets (Max 768px) */
@media (max-width: 768px) {
    .cart-page > .container,
    .cart-hero > .container {
        width: calc(100% - 30px);
    }

    .cart-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .cart-item {
        grid-template-columns: 95px minmax(0, 1fr) auto;
        grid-template-areas:
            "image info remove"
            "image qty  total";
        align-items: center;
        gap: 14px 16px;
        padding: 18px;
    }

    .cart-item-image {
        grid-area: image;
        width: 95px;
        height: 95px;
        align-self: start;
    }

    .cart-item-info {
        grid-area: info;
    }

    .cart-remove-button {
        grid-area: remove;
        justify-self: end;
    }

    .cart-item-quantity {
        grid-area: qty;
        justify-self: start;
        height: 38px;
    }

    .cart-item-quantity .quantity-button {
        width: 34px;
        height: 36px;
        flex: 0 0 34px;
    }

    .cart-item-quantity .quantity-input {
        width: 38px;
        height: 36px;
        flex: 0 0 38px;
    }

    .cart-item-total {
        grid-area: total;
        justify-self: end;
    }
}

/* Mobile Devices (Max 520px) */
@media (max-width: 520px) {
    .cart-page > .container,
    .cart-hero > .container {
        width: calc(100% - 20px);
    }

    .cart-hero {
        padding: 24px 0 20px;
    }

    .cart-breadcrumb {
        margin-bottom: 16px;
        font-size: 12px;
    }

    .cart-heading h1 {
        font-size: 26px;
    }

    .cart-heading p {
        font-size: 13.5px;
    }

    .cart-section-header {
        flex-direction: row;
        align-items: center;
    }

    .cart-section-header h2 {
        font-size: 20px;
    }

    .cart-clear-button {
        min-height: 34px;
        padding: 0 12px;
        font-size: 11px;
    }

    .cart-item {
        grid-template-columns: 80px minmax(0, 1fr) auto;
        grid-template-areas:
            "image info   remove"
            "image qty    qty"
            "image total  total";
        gap: 10px 14px;
        padding: 16px 14px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
        border-radius: 12px;
    }

    .cart-item-info h3 {
        font-size: 15.5px;
        margin-bottom: 4px;
    }

    .cart-item-weight {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .cart-item-price {
        font-size: 14.5px;
    }

    .cart-remove-button {
        min-height: 30px;
        padding: 0 8px;
        font-size: 11px;
    }

    .cart-item-quantity {
        height: 34px;
    }

    .cart-item-quantity .quantity-button {
        width: 30px;
        height: 32px;
        flex: 0 0 30px;
        font-size: 15px;
    }

    .cart-item-quantity .quantity-input {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        font-size: 13px;
    }

    .cart-item-total {
        justify-self: start;
        font-size: 15px;
        margin-top: 2px;
    }

    .cart-summary-card {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .cart-summary-card h2 {
        font-size: 20px;
        margin-bottom: 18px;
    }

    .summary-total strong {
        font-size: 21px;
    }

    .cart-checkout-button {
        min-height: 48px;
        font-size: 14px;
    }
}

/* Small Screens (Max 360px) */
@media (max-width: 360px) {
    .cart-item {
        grid-template-columns: 70px minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 14px 10px;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-item-info h3 {
        font-size: 14px;
    }
}