.rtl-page {
    direction: rtl;
}

.variant {
    width: 100%;
    min-height: 100vh;
    font-family: 'cairo', sans-serif;
    padding: 40px 70px 0;
}

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

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

.product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    min-width: 0;
}

.product-header h1 {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 8px;
}

.product-header p {
    font-size: 1.2rem;
    opacity: .7;
    line-height: 1.6;
}

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

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

.size-guide-link {
    font-size: 1.2rem;
    color: #000000;
    text-decoration: underline;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.variant .btn.active,
.variant .btn:hover {
    color: white;
    background-color: black;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-price .before {
    text-decoration: line-through;
    font-size: 1.5rem;
    color: rgb(51, 51, 51);
}

.product-price .after {
    font-weight: bold;
    font-size: 1.7rem;
    color: black;
}

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

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

.quantity-selector .btn:hover {
    background-color: black;
    color: white;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 380px);
    padding-inline-end: 0;
}

.product-actions .btn.primary {
    color: white;
    background-color: black;
}

.product-actions .btn {
    width: 100%;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid black;
    background-color: transparent;
    color: black;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-actions .btn:hover {
    background-color: black;
    color: white;
}

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

/* --- thumbnails --- */
.thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    row-gap: 2rem;
    margin-bottom: 40px;
}

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

@media (max-width: 1024px) {
    .variant { 
        padding: 30px 40px 0; 
    }

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

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

    .product-gallery img {
        width: 100%;
    }

    .product-header h1 { 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;
    }

    .product-actions { width: min(100%, 340px); }

    .thumbnails { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .variant { 
        padding: 20px 16px 0; 
    }

    .product-display { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
    }

    .product-gallery {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        display: flex;
        justify-content: center;
    }

    .product-gallery img {
        width: 100%;
        object-fit: cover;
    }

    .product-info { 
        width: 100%; 
    }

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

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

    .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;
    }

    .product-actions { 
        width: 100%;
    }

    .thumbnails { 
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.8rem;
        padding: 10px 0;  
    }
}

@media (max-width: 380px) {
    .variant {
        padding: 20px 12px 0;
    }

    .product-display {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .product-gallery {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        display: flex;
        justify-content: center;
    }

    .product-info {
        width: 100%;
    }

    .product-header h1 {
        font-size: 1.3rem;
    }

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

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

    .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;
    }

    .product-actions {
        width: 100%;
    }

    .thumbnails {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 10px 0;
    }
}

/* --- 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: 17vh;
    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;
}

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