/*──────────────────────────────────────────────────────────────────────────────
  Base & RTL
──────────────────────────────────────────────────────────────────────────────*/
#eb-shop-container {
    direction: rtl;
    font-family: ebIRANSans;
    margin: 1rem;
    position: relative;
}
#eb-shop-container a {
    color: #000;
    text-decoration: none;
}

/*──────────────────────────────────────────────────────────────────────────────
  Category grid
──────────────────────────────────────────────────────────────────────────────*/
.eb-shop-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.eb-shop-category img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ddd;
}
/* Center the category name under the icon */
.eb-shop-category div {
    margin-top: .5rem;
    font-weight: bold;
    text-align: center;
}

/*──────────────────────────────────────────────────────────────────────────────
  Instructions panel
  (inline styles in JS handle visibility/layout)
──────────────────────────────────────────────────────────────────────────────*/
#eb-instructions { text-align: center; margin-bottom: 20px;}
#eb-instructions #eb-toggle { font-weight: bold; cursor: pointer; }
#eb-instructions #eb-content { text-align: right; }
@keyframes eb-blink {
    0%,100% { color: #0049A4; font-weight:100;}
    50%    { color: #CE9906; font-weight:900;}
}
#eb-instructions #eb-toggle {
    animation: eb-blink 1s infinite;
}
/*──────────────────────────────────────────────────────────────────────────────
  Tables (shared styles)
──────────────────────────────────────────────────────────────────────────────*/
.eb-shop-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background: #fff;
}
.eb-shop-table th,
.eb-shop-table td {
    border: 1px solid #ccc;
    padding: .5rem;
    text-align: center;
    vertical-align: middle;
}
/* Keep default image sizing */
.eb-shop-table img {
    object-fit: cover;
}

/* Parent rows (variable products) */
.eb-parent-row img {
    width: 150px;
    height: 150px;
    border-radius: 6px;
}
/* All product-table thumbnails */
.eb-prod-table td img {
    width: 150px;
    height: 150px;
    border-radius: 6px;
}

/* Highlight when in basket */
.eb-shop-highlight {
    background: rgba(0, 73, 164, 0.1) !important;
}

/* 2) Out-of-stock row styling */
.eb-out-of-stock {
    position: relative;
    opacity: 0.5;
}
.eb-out-of-stock .eb-oos-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.8);
    padding: .5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    color: #D00;
    pointer-events: none;
}

/* ensure input & button disabled states */
.eb-out-of-stock input[disabled],
.eb-out-of-stock button[disabled] {
    cursor: not-allowed;
}
/*──────────────────────────────────────────────────────────────────────────────
  Basket table tweaks
──────────────────────────────────────────────────────────────────────────────*/
#eb-shop-basket-table img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}
#eb-shop-basket-table input {
    width: 3rem;
    text-align: center;
}

/*──────────────────────────────────────────────────────────────────────────────
  Action buttons (desktop)
──────────────────────────────────────────────────────────────────────────────*/
#eb-shop-actions-wrap { margin-bottom: 2rem; }
@media (min-width: 600px) {
    #eb-shop-actions-wrap {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}
#eb-shop-basket-actions-1 button,
#eb-shop-basket-actions-2 button {
    padding: .5rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
/* “Add to cart” stands out in primary blue */
#eb-shop-basket-actions-2 button {
    background: #0049A4;
    color: #fff;
}
/* Save/load/clear */
#eb-save, #eb-load { background: #CE9906; color: #fff; }
#eb-clear          { background: #EC9700; color: #fff; }

/* Back-to-top: emoji only */
#eb-shop-back-to-top {
    outline: none;
    box-shadow: none;
}

/*──────────────────────────────────────────────────────────────────────────────
  Desktop: hide **only** variation thumbnails (rows where data-key does not end “:0”)
──────────────────────────────────────────────────────────────────────────────*/
@media (min-width: 600px) {
    .eb-prod-table tr[data-key]:not([data-key$=":0"]) td[data-label="تصویر"] img {
        display: none !important;
    }
}

/*──────────────────────────────────────────────────────────────────────────────
  Mobile: Basket remains a normal table, hide only the image column
──────────────────────────────────────────────────────────────────────────────*/
@media (max-width: 600px) {
    #eb-shop-basket-table th:first-child,
    #eb-shop-basket-table td:first-child {
        display: none;
    }
}

/*──────────────────────────────────────────────────────────────────────────────
  Mobile: product-table card-style only for .eb-prod-table
──────────────────────────────────────────────────────────────────────────────*/
@media (max-width: 600px) {
    /* hide headers */
    .eb-prod-table, .eb-prod-table thead { display: none; }
    /* stack rows */
    .eb-prod-table, .eb-prod-table tbody, .eb-prod-table tr, .eb-prod-table td {
        display: block;
        width: 100%;
    }
    .eb-prod-table tr {
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
    }
    .eb-prod-table td {
        padding: .5rem 1rem;
        border: none;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    .eb-prod-table td:last-child { border-bottom: none; }

    /* only show “تعداد” label */
    .eb-prod-table td:before { content: ""; }
    .eb-prod-table td[data-label="تعداد"]:before {
        content: attr(data-label);
        font-weight: bold;
        margin-left: 1rem;
    }

    /* action buttons spacing on mobile */
    #eb-shop-actions-wrap {
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }
    #eb-shop-basket-actions-1 button,
    #eb-shop-basket-actions-2 button {
        display: block;
        width: 100%;
        margin: .25rem 0;
    }
}

/*──────────────────────────────────────────────────────────────────────────────
  Hide parent-product rows on mobile
──────────────────────────────────────────────────────────────────────────────*/
@media (max-width: 600px) {
    .eb-parent-row { display: none !important; }
}

/*──────────────────────────────────────────────────────────────────────────────
  Mobile parent-title link styling
──────────────────────────────────────────────────────────────────────────────*/
.eb-mobile-parent-title {
    display: none;
    font-weight: bold;
    margin-top: .5rem;
}
@media (max-width: 600px) {
    .eb-mobile-parent-title {
        display: block;
    }
    .eb-mobile-parent-title a {
        font-weight: bold;
        color: #0049A4;
        text-decoration: none;
    }
}

/* ── Custom “You still have items” modal ───────────────────────────────── */
.my-leave-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.my-leave-modal > div {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.my-leave-modal button {
    margin: .5rem;
    padding: .5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
}
