﻿.app-wrapper {
    width: 100%;
    max-width: 430px;
    min-height: 100%;
    background-color: #fff;
    position: relative;
    margin: 0 auto;
}

* {
    box-sizing: border-box;
    font-family: "IRANSansWeb";
}

body {
    margin: 0;
    padding: 0;
    padding-bottom: 100px;
    background-color: #f7f7f7;
    direction: rtl;
    justify-content: center;
}

.product-page {
    padding: 16px;
    color: #333;
}

.product-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
}

.product-image-container {
    border: 2.5px solid #000;
    border-radius: 12px;
    padding: 10px;
    background-color: #fff;
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

    .product-image-container img {
        max-width: 80%;
        height: auto;
        max-height: 150px;
        object-fit: contain;
    }

.product-subtitle {
    font-size: 17px;
    font-weight: bold;
    color: #444;
    max-width: 600px;
    width: 90%;
    font-weight: bold;
}

.product-description {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

    .product-description p {
        font-size: 13px;
        line-height: 1.3;
        text-align: justify;
        margin-bottom: 10px;
    }


.seller-box {
    border: 2px solid #000;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px auto;
    width: 90%;
    max-width: 500px;
}

.seller-row {
    display: grid;
    grid-template-columns: 100px 90px 1fr;
    align-items: center;
    padding: 10px 21px;
    margin-bottom: 12px;
    column-gap: 20px;
}

.seller-name span {
    display: inline-block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: bold;
    color: #444;
    margin-bottom: -12px;
}

.stars {
    display: flex;
    gap: 5px;
    height: 20px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: -6px;
}

.star {
    width: 14px;
    height: 14px;
    background-image: url('star.svg');
    background-size: contain;
    background-repeat: no-repeat;
}


.buy-button {
    justify-self: end;
}




.buy-button {
    display: flex;
    align-items: center;
    margin-right: auto;
    margin-bottom: -5px;
}

    .buy-button .btn {
        font-size: 15px;
        padding: 3px 10px;
        gap: 6px;
        display: flex;
        align-items: center;
        border-radius: 999px;
        transform: scale(0.95);
        max-width: 100%;
        background-color: var(--main-bg-color);
        color: #000;
        border: none;
        cursor: pointer;
        margin-top: 5px;
        margin-bottom: 0;
    }

        .buy-button .btn svg {
            margin-left: 4px;
        }

.separator-line {
    height: 1px;
    background-color: #000;
    /*  margin: 0 3px;*/
}

/*
        .star {
            display: inline-block;
            width: 18px;
            height: 18px;
            cursor: pointer;
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;
            transition: background-image 0.3s ease;
            position: relative;
            margin: 0 2px;
        }*/


.star.full {
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 17.77L18.18 21.5L16.54 14.47L22 9.74L14.81 9.13L12 2.5L9.19 9.13L2 9.74L7.46 14.47L5.82 21.5L12 17.77Z' fill='black'/%3E%3C/svg%3E ");
}

.star.half {
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 9.74L14.81 9.12L12 2.5L9.19 9.13L2 9.74L7.46 14.47L5.82 21.5L12 17.77L18.18 21.5L16.55 14.47L22 9.74ZM12 15.9V6.6L13.71 10.64L18.09 11.02L14.77 13.9L15.77 18.18L12 15.9Z' fill='black'/%3E%3C/svg%3E%0A");
}

.star.empty {
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 9.74L14.81 9.12L12 2.5L9.19 9.13L2 9.74L7.46 14.47L5.82 21.5L12 17.77L18.18 21.5L16.55 14.47L22 9.74Z' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E");
}

.popup-table {
    width: 900px;
    max-width: 100%;
    /* height: 200px;*/
    background: #FDF6E7;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
    margin-top: 16px;
    font-size: 14px;
    table-layout: fixed;
    border-radius: 4px;
    border: 1px solid #000;
}

    .popup-table th,
    .popup-table td {
        border: 1px solid #000;
        padding: 10px 12px;
        text-align: center;
        vertical-align: middle;
        word-wrap: break-word;
    }

    .popup-table th {
        background: #FDF6E7;
        font-weight: 600;
        color: #222;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        user-select: none;
    }


    .popup-table tbody tr:last-child td:first-child {
        border-bottom-left-radius: 4px;
    }

    .popup-table tbody tr:last-child td:last-child {
        border-bottom-right-radius: 4px;
    }

.popup-body {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 24.7%;
    background: #FDF6E7;
    z-index: 9999;
    transition: bottom 0.3s ease, opacity 0.3s ease;
    overflow-y: auto;
    max-height: 80vh;
    padding: 12px;
}

.popup-show {
    opacity: 1;
    pointer-events: auto;
}

.plus-minus-btn {
    background-color: transparent !important;
    border: none;
    font-size: 10px;
    padding: 2px 4px;
    cursor: pointer;
    color: #444;
    user-select: none;
    transition: color 0.2s ease;
}

    .plus-minus-btn:hover {
        color: #000;
    }

.color-dropdown {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid black;
    border-radius: 4px;
    font-size: 11px;
    text-align: right;
    background: #FDF6E7;
}

.no-bg-cell {
    border: 1px solid #000;
    padding: 8px;
    background-color: transparent;
}

.quantity-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.quantity-btn {
    padding: 2px 4px;
    font-size: 12px;
    background-color: transparent;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    color: #222;
    transition: all 0.2s ease;
}

    .quantity-btn:hover {
        background-color: #eee;
    }

.quantity-input {
    width: 46px;
    text-align: center;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: transparent;
    padding: 3px 5px;
    font-size: 12px;
}


    .quantity-input::-webkit-outer-spin-button,
    .quantity-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }


    .quantity-input[type=number] {
        -moz-appearance: textfield;
    }

.btn-view-basket {
    width: 55%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding: 14px 0;
    font-size: 18px;
    border-radius: 10px;
    border: none;
    background: var(--main-bg-color);
    color: #000;
    cursor: pointer;
    transition: background-color 0.25s ease;
    margin-left: 30%;
    margin-right: 23%;
    font-weight: bold;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    font-size: 13px;
    user-select: none;
}

.custom-select-trigger {
    padding: 6px 4px;
    border: 1px solid black;
    border-radius: 6px;
    background: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #444;
}

    .custom-select-trigger .arrow {
        width: 4px;
        height: 4px;
        border-right: 2px solid #444;
        border-bottom: 2px solid #444;
        transform: rotate(45deg);
        transition: transform 0.3s ease;
        margin-right: 3px;
    }

    .custom-select-trigger.open .arrow {
        transform: rotate(-135deg);
    }

    .custom-select-trigger.open {
        border-bottom: none;
        border-radius: 6px 6px 0 0;
    }


.selected-option {
    font-size: 8px;
    white-space: nowrap;
}


.custom-options {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: #FFFFFF;
    border: 1px solid black;
    border-top: none;
    border-radius: 0 0 6px 6px;
    display: none;
    z-index: 10;
}

.custom-option {
    padding: 6px 0;
    cursor: pointer;
    color: #333;
    text-align: right;
    transition: background-color 0.2s;
    font-size: 9px;
}


    .custom-option input[type="radio"] {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        border: 1px solid #000;
        outline: none;
        transition: 0.2s;
        appearance: none;
        background-color: #ccc;
        cursor: pointer;
        position: relative;
        margin: 0;
        margin-right: 15px;
        flex-shrink: 0;
    }

        .custom-option input[type="radio"]:checked {
            border-color: #555;
            background-color: #555;
        }

.custom-close-line {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 50px;
    height: 4px;
    background-color: #333;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transform: translateX(-50%);
}



.star.full {
    fill: var(--main-bg-color);
}

.star.half {
    fill: var(--main-bg-color);
}

.star.empty {
    fill: var(--main-bg-color);
}



.row-cols-lg-4 > * {
    flex: 0 0 auto;
    /* width: 25%; */
}

.product-thumbnails {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: start;
    height: 80px;
}

    .product-thumbnails .swiper-wrapper {
        display: flex;
        gap: 10px;
    }

    .product-thumbnails .swiper-slide {
        height: 80px !important;
        flex-shrink: 0;
        position: relative;
        cursor: pointer;
    }

    .product-thumbnails .thumb-img {
        width: 73%;
        height: 100%;
        object-fit: cover;
        border-radius: 5px;
        border: 2px solid #9999;
    }

    .product-thumbnails .swiper-slide-thumb-active .thumb-img {
        border-color: #6f42c1;
    }

    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 20px !important;
        color: #000;
    }
.swiper-wrapper{
  margin-right: 15px;
}
.swiper-slide {
    margin-left: 0 !important;
}

.btn-view-basket {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-view-basket .notif-spinner {
        display: none;
    }

    .btn-view-basket.loading .btn-text {
        display: none; 
    }

    .btn-view-basket.loading .notif-spinner {
        display: inline-block;
        animation: spin 0.8s linear infinite;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.buyBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}

.btn-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notif-spinner {
    display: none;
}

.buyBtn.loading .btn-content {
    display: none; 
}

.buyBtn.loading .notif-spinner {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 780px) {
    .product-subtitle {
        font-size: 17px;
        font-weight: bold;
        color: #444;
        max-width: 600px;
        width: 90%;
        font-weight: bold;
        margin-right: 5px;
    }

    .product-page {
        position: relative;
        top: 0;
        padding-top: 10px;
    }

    .product-title {
        margin-top: 3px;
        margin-bottom: 13px;
        font-size: 16px;
        margin-right: 6px;
    }

    .popup-body {
        position: fixed;
        bottom: -100%;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        height: auto;
        max-height: 80vh;
        background: #FDF6E7;
        padding: 20px;
        direction: rtl;
        z-index: 9999;
        transition: bottom 0.5s ease;
        overflow-y: auto;
        box-sizing: border-box;
    }


    .popup-table {
        width: 100%;
        font-size: 14px;
        text-align: center;
        max-height: 180px;
        overflow: visible;
    }


        .popup-table th,
        .popup-table td {
            padding: 8px 6px;
            font-size: 10px;
        }

    .quantity-btn {
        font-size: 12px;
        padding: 2px 5px;
    }

    .quantity-input {
        width: 65px;
        font-size: 12px;
        padding: 2px;
    }

    .color-dropdown {
        font-size: 12px;
        padding: 5px 6px;
    }

    .btn-view-basket {
        padding: 8px 16px;
        font-size: 13px;
    }

    .close-btn {
        font-size: 26px;
        top: 10px;
        left: 12px;
    }

    .popup-section-title {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .custom-close-line {
        position: absolute;
        top: 10px;
        left: 50%;
        width: 50px;
        height: 4px;
        background-color: #333;
        border: none;
        border-radius: 3px;
        cursor: pointer;
        transform: translateX(-50%);
    }


    .custom-select-wrapper {
        font-size: 10px;
    }

    .custom-select-trigger {
        padding: 5px 6px;
        border-radius: 4px;
    }

        .custom-select-trigger .arrow {
            width: 7px;
            height: 7px;
            border-right: 1.5px solid #444;
            border-bottom: 1.5px solid #444;
            margin-right: 6px;
        }

        .custom-select-trigger.open {
            border-bottom: none;
            border-radius: 6px 6px 0 0;
        }

    .custom-options {
        /*                display: flex;
*/ gap: 6px;
        flex-wrap: nowrap;
        justify-content: flex-end;
        font-size: 9px;
        direction: rtl;
        padding: 3px;
    }

    .custom-option {
        display: flex;
        align-items: center;
        gap: 6px;
        background: white;
        padding: 2px 4px;
        border-radius: 5px;
        cursor: pointer;
        user-select: none;
        border: 1px solid transparent;
        transition: border-color 0.3s, background-color 0.3s;
    }

        .custom-option:hover {
            background-color: #ccc;
        }

        .custom-option input[type="radio"] {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            border: 1px solid #000;
            outline: none;
            transition: 0.2s;
            appearance: none;
            background-color: #ccc;
            cursor: pointer;
            position: relative;
            margin: 0;
            flex-shrink: 0;
        }

            .custom-option input[type="radio"]:checked {
                border-color: #555;
                background-color: #555;
            }

        .custom-option span {
            pointer-events: none;
        }

    .seller-box {
        transform: scaleX(0.9) scaleY(0.8);
        transform-origin: top center;
        margin-left: 5px;
        margin-right: 5px;
        margin: 20px auto;
        width: 100%;
        max-width: 600px;
    }
}

    @media (max-width: 1024px) {
        .app-wrapper {
            width: 100%;
            max-width: 430px;
            min-height: 100vh;
            background-color: #fff;
            position: relative;
            margin: 0 auto;
        }
    }
