.page-hero {
    background: linear-gradient(135deg, #e8f5e9, #ffffff);
    border-radius: 18px;
    padding: 20px 24px;
    margin-top: 16px;
    margin-bottom: 18px;
}
.page-hero-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--main-green);
    margin: 0;
}

.cart-wrapper-section {
    margin-bottom: 40px;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(230px, 0.9fr);
    gap: 14px;
    align-items: flex-start;
}

.cart-items-box {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 12px 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}

.cart-items-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 6px;
    border-radius: 14px;
    transition: background-color 0.12s ease;
}
.cart-item + .cart-item {
    border-top: 1px solid #f2f2f2;
    margin-top: 4px;
    padding-top: 10px;
}
.cart-item:hover {
    background-color: #fafafa;
}

.cart-item-img-wrap {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f7f7f7;
    flex-shrink: 0;
}
.cart-item-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cart-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #222;
    margin: 0;
}
.cart-item-price {
    font-size: 0.78rem;
    color: #2e7d32;
    font-weight: 600;
}
.cart-item-old-price {
    font-size: 0.65rem;
    color: #b0b0b0;
    text-decoration: line-through;
    margin-inline-start: 4px;
}
.cart-item-line {
    font-size: 0.7rem;
    color: #777;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 80px;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 999px;
    background-color: #f5f5f5;
    font-size: 0.72rem;
}
.qty-btn {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: none;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #2e7d32;
    cursor: pointer;
    padding: 0;
}
.qty-btn:hover {
    background-color: #e8f5e9;
}
.qty-input {
    width: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.7rem;
    outline: none;
}

.remove-btn {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.7rem;
    color: #c62828;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.remove-btn i {
    font-size: 0.7rem;
}

.cart-summary-box {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 12px 12px 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cart-summary-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2e7d32;
    margin: 0 0 4px;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #555;
}
.cart-summary-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2e7d32;
}

.btn-cart-checkout {
    margin-top: 6px;
    width: 100%;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: var(--main-green);
    border-color: var(--main-green);
}
.btn-cart-checkout:hover {
    background-color: #256628;
    border-color: #256628;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}

.btn-cart-continue {
    width: 100%;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.78rem;
    margin-top: 4px;
    border: 1px solid #e0e0e0;
    background-color: #fafafa;
    color: #555;
    text-decoration: none;
    text-align: center;
}
.btn-cart-continue:hover {
    background-color: #f0f0f0;
}

.cart-empty-box {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 20px 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
    text-align: center;
    font-size: 0.8rem;
    color: #777;
}
.cart-empty-box i {
    font-size: 1.6rem;
    color: var(--main-green);
    margin-bottom: 6px;
    display: block;
}
.cart-empty-box a {
    color: var(--main-green);
    text-decoration: none;
    font-weight: 600;
}
.cart-empty-box a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

/* منطق الفوتر في صفحة السلة */

/* الوضع الافتراضي (ديسكتوب / تابلت): الفوتر ثابت أسفل الشاشة */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10;
}

@media (min-width: 577px) {
    .cart-page-main {
        padding-bottom: 140px; /* مساحة للفوتر الثابت */
    }
}

@media (max-width: 576px) {
    .page-hero {
        padding: 16px 14px;
        margin-top: 10px;
        margin-bottom: 14px;
    }
    .page-hero-title {
        font-size: 1.2rem;
    }
    .cart-wrapper-section {
        margin-bottom: 70px;
    }
    .cart-items-box,
    .cart-summary-box,
    .cart-empty-box {
        border-radius: 16px;
        padding: 12px 10px;
    }
    /* في وضع الهاتف: إخفاء الفوتر تماماً */
    footer {
        display: none !important;
    }
}
