/**
 * پینکو یدک - استایل صفحه اصلی (Homepage)
 */

/* حذف سراسری هدر وودمارت */
.whb-header, .whb-mobile-header, .woodmart-header, .wd-toolbar, .woodmart-toolbar {
    display: none !important;
}

.py-home-wrapper {
    direction: rtl;
    text-align: right;
    font-family: tahoma, sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    z-index: 9998;
    overflow: hidden;
    margin: 0;
}

/* لایت‌باکس تصویر */
.py-img-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.py-lightbox-content {
    max-width: 95%;
    max-height: 85%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
    background: #ffffff !important;
    padding: 10px !important;
    object-fit: contain !important;
}

.py-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.py-lightbox-close:hover {
    color: #ff4e00;
}

.py-clickable-img {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.py-clickable-img:hover {
    opacity: 0.8;
}

/* سرچ باکس */
.py-search-box {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.py-search-box:focus {
    border-color: #ff4e00;
    outline: none;
}

/* بنرهای دسته‌بندی */
.py-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.py-banner-item {
    color: #fff;
    padding: 12px 10px;
    text-align: center;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.py-banner-item:hover {
    transform: translateY(-3px);
}

/* آکاردئون زیرمنوها */
.py-accordion-panel {
    display: none;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-right: 4px solid #ff4e00 !important;
    border-radius: 6px !important;
    padding: 12px 8px !important;
    margin-bottom: 15px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    text-align: center !important;
}

.py-sub-cat-btn {
    display: inline-block !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    padding: 6px 14px !important;
    margin: 4px !important;
    border-radius: 20px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    font-size: 12px !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.py-sub-cat-btn:hover,
.py-sub-cat-active {
    background: #ff4e00 !important;
    color: #fff !important;
    border-color: #ff4e00 !important;
    box-shadow: 0 3px 8px rgba(255,78,0,0.2) !important;
}

/* دکمه سبد خرید */
.py-floating-cart-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.py-floating-cart-btn:hover {
    background: #ff4e00;
    transform: scale(1.05);
}

/* پنل‌های بالا و پایین */
.py-top-panel {
    flex-shrink: 0;
    padding: 12px 15px 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.py-top-panel.py-shrunk .py-search-box {
    padding: 7px 12px;
    font-size: 13px;
    margin-bottom: 8px;
}

.py-top-panel.py-shrunk .py-banner-grid {
    gap: 5px;
    margin-bottom: 8px;
}

.py-top-panel.py-shrunk .py-banner-item {
    padding: 8px;
    font-size: 12px;
}

.py-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
}

.py-bottom-panel {
    flex-shrink: 0;
    background: #fff;
    padding: 10px 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    display: flex;
    justify-content: center;
    align-items: center;
}

.py-cart-badge {
    background: #ff4e00;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* جدول محصولات */
.py-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
}

.py-order-table tr {
    border-bottom: 1px solid #eee;
}

.py-order-table th {
    padding: 10px;
    background: #f4f4f6;
    font-weight: bold;
}

.py-order-table td {
    padding: 10px;
    vertical-align: middle;
}

.py-row-selected {
    background: #ebfbeb !important;
}

.py-order-table tr.py-row-clicked,
.py-order-table tr.py-row-clicked td {
    background: #ffffff !important;
    border-color: #ff4e00 !important;
}

.py-order-table tr.py-row-clicked {
    box-shadow: 0 4px 12px rgba(255, 78, 0, 0.15) !important;
}

/* کنترل تعداد */
.py-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.py-qty-b {
    background: #222;
    color: #fff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.py-del-b {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    width: 100%;
}

/* حذف فلش‌های اینپوت عددی */
#py-cart-modal input[type=number]::-webkit-outer-spin-button,
#py-cart-modal input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ═══════════════════════════════════════
   ریسپانسیو موبایل
   ═══════════════════════════════════════ */
@media screen and (max-width: 768px) {
    .py-home-wrapper {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        height: auto !important;
        min-height: 100vh;
        display: block !important;
        overflow: visible !important;
    }

    .py-scroll-area {
        overflow: visible !important;
        flex: none !important;
        height: auto !important;
        padding-bottom: 110px !important;
    }

    .py-bottom-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #fff !important;
        z-index: 9998 !important;
        padding: 10px 15px 8px !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .py-top-panel {
        display: contents !important;
    }

    #py-main-search {
        position: sticky !important;
        top: 0px !important;
        z-index: 9999 !important;
        background: #fff !important;
        border: 2px solid #ddd !important;
        border-radius: 0 0 8px 8px !important;
        margin: 0 !important;
        padding: 12px 15px !important;
        box-sizing: border-box !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    }

    .py-banner-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        margin-bottom: 12px;
        margin-top: 10px !important;
    }

    .py-banner-item {
        padding: 15px 10px;
        font-size: 14px;
    }

    .py-top-panel.py-shrunk .py-search-box {
        padding: 12px 15px;
        font-size: 15px;
        margin-bottom: 25px;
    }

    .py-top-panel.py-shrunk .py-banner-grid {
        gap: 8px;
        margin-bottom: 12px;
    }

    .py-top-panel.py-shrunk .py-banner-item {
        padding: 15px 10px;
        font-size: 14px;
    }

    /* جدول محصولات موبایل */
    .py-order-table thead {
        display: none;
    }

    .py-order-table,
    .py-order-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .py-order-table tr {
        display: grid !important;
        grid-template-columns: 55px 1fr 68px 80px !important;
        grid-template-rows: auto auto !important;
        gap: 2px 4px !important;
        margin-bottom: 6px !important;
        border: 1px solid #e5e5e5 !important;
        border-radius: 6px !important;
        padding: 6px !important;
        background: #f7f7f7;
        transition: background 0.2s ease;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .py-order-table td {
        display: flex !important;
        padding: 0 !important;
        border: none !important;
        font-size: 11px !important;
        width: auto !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow: hidden !important;
    }

    .py-order-table td::before {
        content: none !important;
    }

    .py-order-table td:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
        justify-content: center !important;
    }

    .py-order-table td:nth-child(1) img {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        object-fit: cover !important;
        border-radius: 4px !important;
        display: block !important;
    }

    .py-order-table td.py-td-title {
        grid-column: 2 !important;
        grid-row: 1 !important;
        font-size: 11px !important;
        font-weight: bold !important;
        line-height: 1.3 !important;
        white-space: normal !important;
    }

    .py-order-table td:nth-child(2) {
        grid-column: 2 !important;
        grid-row: 2 !important;
        color: #666 !important;
        font-size: 10px !important;
    }

    .py-order-table td:nth-child(2)::before {
        content: "کد: " !important;
        display: inline !important;
        font-weight: bold !important;
        color: #888 !important;
        margin-left: 2px;
    }

    .py-order-table td:nth-child(4) {
        grid-column: 3 !important;
        grid-row: 1 / span 2 !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .py-qty-control {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1px !important;
        background: #fff !important;
        border: 1px solid #ccc !important;
        border-radius: 4px !important;
        padding: 1px !important;
        width: 100% !important;
        max-width: 64px !important;
        box-sizing: border-box !important;
    }

    .py-qty-b {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
        font-size: 11px !important;
        background: #cc3e00 !important;
        color: #fff !important;
        border-radius: 2px !important;
        border: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        cursor: pointer !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .py-qty-control input {
        width: 22px !important;
        height: 18px !important;
        font-size: 11px !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: center !important;
        background: transparent !important;
        -moz-appearance: textfield !important;
    }

    .py-qty-control input::-webkit-outer-spin-button,
    .py-qty-control input::-webkit-inner-spin-button {
        -webkit-appearance: none !important;
        margin: 0 !important;
    }

    .py-order-table td:nth-child(5) {
        grid-column: 4 !important;
        grid-row: 1 / span 2 !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .py-order-table td:nth-child(5) .button,
    .py-order-table td:nth-child(5) .py-del-b {
        padding: 4px 2px !important;
        font-size: 9px !important;
        font-weight: bold !important;
        text-align: center !important;
        line-height: 1.2 !important;
        border-radius: 4px !important;
        width: 100% !important;
        min-width: auto !important;
        max-width: 100% !important;
        min-height: auto !important;
        height: 32px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* دکمه برگشت به بالا */
    #py-back-to-top {
        display: flex !important;
        position: fixed;
        bottom: 75px;
        left: 20px;
        background: #111;
        color: #fff;
        border: none;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        font-size: 20px;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        z-index: 99999;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        transition: 0.2s;
    }

    #py-back-to-top:active {
        background: #ff4e00;
    }

    /* جدول فاکتور مشتری موبایل */
    .py-cust-invoice-table thead {
        display: none !important;
    }

    .py-cust-invoice-table,
    .py-cust-invoice-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .py-cust-invoice-table tr {
        display: grid !important;
        grid-template-columns: 45px 1fr 70px 30px !important;
        grid-template-rows: auto auto !important;
        gap: 5px !important;
        padding: 8px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
        margin-bottom: 8px !important;
        background: #fff !important;
    }

    .col-img {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .col-name {
        grid-column: 2;
        grid-row: 1;
        font-weight: bold;
        font-size: 12px;
    }

    .col-sku {
        grid-column: 2;
        grid-row: 2;
        font-size: 10px;
        color: #666;
    }

    .col-qty {
        grid-column: 3;
        grid-row: 1;
        justify-self: center;
    }

    .py-price-col {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        font-size: 10px;
        color: #666;
        margin-left: 10px;
    }

    .py-total-col {
        grid-column: 3;
        grid-row: 2;
        font-weight: bold;
        color: #ff4e00 !important;
        font-size: 11px;
        justify-self: center;
    }

    .col-del {
        grid-column: 4;
        grid-row: 1 / span 2;
        justify-self: center;
    }

    /* لیست استعلام‌های مشتری موبایل */
    #py-customer-invoices-list-container thead {
        display: none !important;
    }

    #py-customer-invoices-list-container table,
    #py-customer-invoices-list-container tbody {
        display: block !important;
        width: 100% !important;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 6px !important;
        padding: 10px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
        margin-bottom: 8px !important;
        background: #fff !important;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) td {
        display: flex !important;
        padding: 0 !important;
        border: none !important;
        font-size: 12px !important;
        align-items: center !important;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        font-weight: bold;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) td:nth-child(4) {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) td:nth-child(2) {
        grid-column: 1 / span 2;
        grid-row: 2;
        color: #666;
        font-size: 10px;
        border-bottom: 1px dashed #eee;
        padding: 4px 0;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) td:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
        color: #00cc66;
        font-weight: bold;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) td:nth-child(5) {
        grid-column: 2;
        grid-row: 3;
        justify-content: flex-end;
    }

    #py-customer-invoices-list-container tr:not([id^="py_customer_items_row_"]) td:nth-child(5) button {
        padding: 4px 10px !important;
        font-size: 11px !important;
        height: 28px !important;
    }

    #py-customer-invoices-list-container tr[id^="py_customer_items_row_"].py-open-row {
        display: block !important;
        width: 100% !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 6px !important;
    }

    /* مودال سبد خرید موبایل */
    #py-modal-cart-contents {
        max-height: 210px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #py-cart-customer-note {
        height: 50px !important;
        min-height: 50px !important;
        resize: none !important;
    }
}