.rtl-page {
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.cart-page {
    width: 100%;
    min-height: 100vh;
    font-family: 'Cairo', sans-serif;
    background-color: #fff;
}

.cart-page .heading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 105px;
    background-image: url("/static/assets/background_image.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cart-page .heading h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    font-family: 'Exo 2', sans-serif;
}

.cart-layout {
    width: 100%;
    padding: 40px 70px 40px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* --- product display inherited from variant --- */
.product-display {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 2rem;
    align-items: center;
}

.product-gallery {
    width: 100%;
}

.product-gallery img {
    width: 100%;
    aspect-ratio: 1 / 1.1;
    display: block;
    object-fit: cover;
    border-radius: 15px;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    gap: 16px;
}

.product-header {
    width: 100%;
}

.product-header h2 {
    font-size: 2rem;
    line-height: 1.3;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
}

.product-header p {
    font-size: 1.2rem;
    color: #6a6a6a;
    line-height: 1.6;
}

.product-header .custom-tag {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f766e;
    background: #ccfbf1;
    padding: 4px 10px;
    border-radius: 999px;
}

.size-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-selector .btn {
    width: 80px;
    height: 40px;
    flex: 0 0 auto;
    border: 2px solid #111;
    border-radius: 25px;
    background-color: transparent;
    color: #111;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.size-selector .btn.active,
.size-selector .btn:hover {
    background-color: #111;
    color: #fff;
}

.product-price {
    width: 100%;
    text-align: right;
}

.product-price span {
    font-size: 1.7rem;
    font-weight: 700;
    color: #111;
}

.product-price small {
    display: block;
    margin-top: 4px;
    font-size: 0.9rem;
    color: #6a6a6a;
}

.custom-preview-link {
    font-size: 0.92rem;
    color: #0f172a;
    font-weight: 700;
    text-decoration: underline;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #111;
    background-color: transparent;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-selector .btn:hover {
    background-color: #111;
    color: #fff;
}

.qty-display {
    width: 84px;
    min-height: 40px;
    border-radius: 25px;
    background-color: #111;
    color: #fff;
    border: 2px solid #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex: 0 0 auto;
    padding: 0 12px;
}

.remove-btn {
    width: min(100%, 380px);
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffd5dc 0%, #ffb1bd 100%);
    color: #d4564a;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 24px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.remove-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(255, 177, 189, 0.28);
}

.cart-summary {
    padding-top: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.summary-total {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: #111;
}

.summary-total .label,
.summary-total .value {
    font-size: 2rem;
    font-weight: 800;
}

/* --- empty state --- */
.empty-state {
    width: 100%;
    min-height: 100vh;
    background-color: white;
    font-family: 'Poppins', sans-serif;
}

.empty-state .heading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 105px;
    background-image: url("/static/assets/background_image.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.empty-state .heading h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    font-family: 'Exo 2', sans-serif;
}

.empty-state .error-message {
    height: calc(100vh - 17vh);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 18px;
}

.empty-state .error-message p {
    font-size: 2.2rem;
    opacity: 0.8;
    font-weight: bold;
}

.empty-cart-btn {
    border-color: black;
    color: black;
}

.empty-cart-btn:hover {
    background-color: black;
    color: #fff;
}

@media (max-width: 900px) {
    .cart-layout {
        padding: 30px 40px 30px;
    }

    .product-display {
        grid-template-columns: minmax(260px, 350px) 1fr;
        gap: 18px;
    }

    .product-gallery {
        width: 100%;
        max-width: 350px;
    }

    .product-header h2 {
        font-size: 1.5rem;
    }

    .product-header p {
        font-size: 1rem;
    }

    .size-selector {
        justify-content: flex-start;
    }

    .size-selector .btn {
        width: auto;
        min-width: 0;
        padding-inline: 18px;
    }

    .quantity-selector {
        width: fit-content;
        justify-content: flex-start;
        align-self: flex-start;
    }

    .qty-display {
        width: auto;
        min-width: 64px;
        flex: 0 0 auto;
    }

    .summary-total .label,
    .summary-total .value {
        font-size: 2rem;
    }
}

@media (max-width: 700px) {
    .cart-page .heading h1,
    .empty-state .heading h1 {
        font-size: 2.1rem;
    }

    .cart-layout {
        padding: 20px 16px 20px;
    }

    .product-display {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-gallery {
        width: 100%;
    }

    .product-info {
        padding: 0;
    }

    .product-header h2 {
        font-size: 1.4rem;
    }

    .product-header p {
        font-size: 0.95rem;
    }

    .size-selector {
        gap: 8px;
        justify-content: flex-start;
    }

    .size-selector .btn {
        width: auto;
        min-width: 0;
        padding-inline: 18px;
    }

    .product-price span {
        font-size: 1.7rem;
    }

    .quantity-selector {
        width: fit-content;
        gap: 10px;
        justify-content: flex-start;
        align-self: flex-start;
    }

    .quantity-selector .btn,
    .qty-display {
        height: 40px;
    }

    .quantity-selector .btn {
        width: 40px;
    }

    .qty-display {
        width: auto;
        min-width: 64px;
        flex: 0 0 auto;
    }

    .remove-btn {
        width: 100%;
    }

    .summary-total .label,
    .summary-total .value {
        font-size: 1.75rem;
    }

}

@media (max-width: 420px) {
    .cart-page .heading h1,
    .empty-state .heading h1 {
        font-size: 1.9rem;
    }

    .cart-layout {
        padding-inline: 12px;
    }

    .product-header h2 {
        font-size: 1.25rem;
    }

    .product-header p {
        font-size: 0.9rem;
    }

    .size-selector .btn {
        width: auto;
        min-width: 0;
        padding-inline: 16px;
    }

    .quantity-selector {
        width: fit-content;
        justify-content: flex-start;
        align-self: flex-start;
    }

    .qty-display {
        width: auto;
        min-width: 60px;
        flex: 0 0 auto;
    }

    .summary-total .label,
    .summary-total .value {
        font-size: 1.5rem;
    }
}
