/* =========================================================
   NikDarman Tools - Product Packages 1.0.9
   Front-end / Woodmart friendly RTL layout
   ========================================================= */

.ndt-packages-grid,
.ndt-package-single,
.ndt-package-template-wrap,
.ndt-package-card,
.ndt-package-card * ,
.ndt-package-single * {
    box-sizing: border-box;
}

.ndt-packages-grid,
.ndt-package-single,
.ndt-package-template-wrap {
    direction: rtl;
    text-align: right;
}

/* ---------- Package cards / homepage ---------- */
.ndt-packages-grid {
    --ndt-columns: 4;
    --ndt-gold: #D4AF37;
    display: grid;
    grid-template-columns: repeat(var(--ndt-columns), minmax(0, 1fr));
    gap: 1px;
    background: var(--ndt-gold);
    border: 5px solid var(--ndt-gold);
    border-radius: 18px;
}

.ndt-package-card {
    --ndt-accent: #00b4d8;
    background: #fff;
    border: 1px solid #D4AF37;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(16, 42, 67, .08);
    transition: .25s ease;
    position: relative;
    text-align: right;
}

.ndt-package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px rgba(16, 42, 67, .14);
}

.ndt-package-media {
    display: block;
    position: relative;
    background: #f8fafc;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.ndt-package-media > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.ndt-package-badge,
.ndt-package-single-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #D4AF37;
    color: #111;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.ndt-package-badge {
    position: absolute;
    z-index: 3;
    right: 12px;
    top: 12px;
    width: 52px;
    height: 52px;
    min-width: 52px;
    padding: 0;
    border-radius: 50%;
    line-height: 1;
    font-size: 14px;
    font-weight: 800;
    color: #111;
    background: #D4AF37;
    box-shadow: 0 3px 10px rgba(16, 42, 67, .12);
}

.ndt-package-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    height: 100%;
    padding: 16px;
}

.ndt-package-collage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
}

.ndt-package-body {
    padding: 17px;
    text-align: right;
}

.ndt-package-body h3 {
    font-size: 17px;
    line-height: 1.8;
    margin: 0 0 4px;
    text-align: right;
}

.ndt-package-body h3 a { color: #102a43; }
.ndt-package-count { display: none !important; }

.ndt-package-price-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 11px 12px;
    margin-bottom: 14px;
    text-align: right;
}

.ndt-package-price-box del { display: block; color: #829ab1; font-size: 12px; }
.ndt-package-price-box strong { display: block; font-size: 18px; color: #102a43; margin-top: 2px; }
.ndt-package-saving { display: inline-block; margin-top: 5px; color: #168a49; font-size: 12px; font-weight: 700; }

.ndt-package-actions { display: flex; gap: 8px; align-items: stretch; }
.ndt-package-view,
.ndt-package-add-form button,
.ndt-package-unavailable {
    min-height: 39px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 700;
}
.ndt-package-view { flex: 1; background: #eef4f8; color: #627d98; }
.ndt-package-add-form { margin: 0; flex: 1; }
.ndt-package-add-form button { width: 100%; border: 0; background: var(--ndt-accent); color: #fff; cursor: pointer; }
.ndt-package-unavailable { flex: 1; background: #f5f5f5; color: #8a8a8a; }
.ndt-packages-empty { padding: 18px; border: 1px dashed #cbd5e1; border-radius: 12px; text-align: center; background: #f8fafc; }

/* ---------- Dedicated single package template ---------- */
.ndt-package-template-wrap {
    background: #f8fafc;
    padding: 34px 0 54px;
    min-height: 70vh;
}

.ndt-package-template-container {
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
    padding-inline: 20px;
}

.ndt-package-template-main {
    width: 100%;
}

.ndt-package-single {
    --ndt-accent: #00b4d8;
    width: 100%;
    margin: 0;
    color: #102a43;
    font-family: inherit;
    text-align: right !important;
}

.ndt-package-single a,
.ndt-package-single div,
.ndt-package-single span,
.ndt-package-single h1,
.ndt-package-single h2,
.ndt-package-single h3,
.ndt-package-single label,
.ndt-package-single form {
    text-align: right;
}

.ndt-package-page-header {
    margin-bottom: 18px;
}

.ndt-package-title-wrap {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
}

.ndt-package-page-title {
    margin: 0 !important;
    padding: 0;
    color: #102a43;
    font-size: clamp(24px, 2.2vw, 34px);
    line-height: 1.5;
    font-weight: 800;
}

.ndt-package-page-count {
    color: #627d98;
    background: #eef4f8;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    white-space: nowrap;
}

/* RTL auto placement: media = right, price = center, items = left */
.ndt-package-main-grid {
    direction: rtl;
    display: grid;
    grid-template-columns: minmax(310px, 1.15fr) minmax(275px, .82fr) minmax(360px, 1.35fr);
    gap: 18px;
    align-items: stretch;
}

.ndt-package-visual-panel,
.ndt-package-buy-panel,
.ndt-package-items-panel {
    background: #fff;
    border: 1px solid #e2ebf2;
    border-radius: 20px;
    box-shadow: 0 10px 34px rgba(16, 42, 67, .055);
    min-width: 0;
}

.ndt-package-visual-panel {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ndt-package-visual {
    position: relative;
    width: 100%;
    min-height: 390px;
    height: 100%;
    max-height: 520px;
    border-radius: 16px;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ndt-package-visual > img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 390px;
    max-height: 500px;
    object-fit: contain;
    padding: 24px;
}

.ndt-package-visual .ndt-package-collage {
    min-height: 390px;
}

.ndt-package-buy-panel {
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.ndt-package-buy-title {
    color: #102a43;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 15px;
    padding-bottom: 13px;
    border-bottom: 1px solid #edf2f6;
}

.ndt-package-single-prices {
    display: grid;
    gap: 10px;
}

.ndt-package-regular-price,
.ndt-package-single-final,
.ndt-package-single-saving {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 12px;
    padding: 11px 12px;
    line-height: 1.6;
}

.ndt-package-regular-price {
    background: #f8fafc;
    color: #627d98;
}

.ndt-package-regular-price del {
    color: #829ab1;
    font-size: 14px;
}

.ndt-package-single-final {
    background: color-mix(in srgb, var(--ndt-accent) 8%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--ndt-accent) 23%, #e6eef4);
}

.ndt-package-single-final span { color: #627d98; font-size: 13px; }
.ndt-package-single-final strong { color: var(--ndt-accent); font-size: 22px; font-weight: 900; white-space: nowrap; }

.ndt-package-single-saving {
    background: #f0fbf5;
    color: #168a49;
    font-size: 13px;
}
.ndt-package-single-saving strong { color: #168a49; white-space: nowrap; }

.ndt-package-stock {
    margin-top: 14px;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 12px;
    font-weight: 700;
}
.ndt-package-stock-in { background: #f0fbf5; color: #168a49; }

.ndt-package-single-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
    margin-top: auto;
    padding-top: 17px;
}

.ndt-package-qty-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ndt-package-qty-field label {
    margin: 0;
    color: #334e68;
    font-size: 13px;
    font-weight: 700;
}

.ndt-package-single-form input[type="number"] {
    width: 78px;
    min-height: 42px;
    text-align: center !important;
    border: 1px solid #d9e4ec;
    border-radius: 9px;
    background: #fff;
}

.ndt-package-single-form button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 11px;
    background: var(--ndt-accent);
    color: #fff;
    font-weight: 800;
    padding: 12px 16px;
    cursor: pointer;
    transition: .2s ease;
}
.ndt-package-single-form button:hover { filter: brightness(.94); }

.ndt-package-alert {
    margin-top: 15px;
    background: #fff3f3;
    border: 1px solid #ffd2d2;
    color: #9f2d2d;
    padding: 12px;
    border-radius: 10px;
}

.ndt-package-items-panel {
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.ndt-package-items-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.ndt-package-items-heading h2 {
    margin: 0 !important;
    font-size: 18px;
    color: #102a43;
    font-weight: 800;
}

.ndt-package-items-heading > span {
    color: #627d98;
    background: #f1f5f8;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    white-space: nowrap;
}

.ndt-package-products-list-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-content: start;
}

.ndt-package-product-row {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 82px;
    background: #fff;
    border: 1px solid #e5edf3;
    border-radius: 13px;
    padding: 8px 10px;
    color: #102a43;
    text-decoration: none !important;
    transition: .18s ease;
    overflow: visible;
}

.ndt-package-product-row:hover {
    border-color: color-mix(in srgb, var(--ndt-accent) 35%, #dce6ed);
    box-shadow: 0 5px 15px rgba(16, 42, 67, .05);
}

.ndt-package-product-image {
    display: flex;
    width: 66px;
    height: 66px;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
}

.ndt-package-product-image img {
    display: block;
    width: 62px !important;
    height: 62px !important;
    max-width: 62px !important;
    object-fit: contain;
    margin: 0 !important;
}

.ndt-package-product-info {
    display: block;
    min-width: 0;
    overflow: visible;
}

.ndt-package-product-name {
    display: block !important;
    width: 100%;
    color: #102a43;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.75;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: normal;
    overflow-wrap: anywhere;
}

.ndt-package-product-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 28px;
    padding-inline: 8px;
    border-radius: 999px;
    color: var(--ndt-accent);
    background: color-mix(in srgb, var(--ndt-accent) 9%, #fff);
    font-weight: 900;
    font-size: 12px;
    white-space: nowrap;
}

.ndt-package-description {
    margin-top: 20px;
    padding: 22px;
    background: #fff;
    border: 1px solid #e2ebf2;
    border-radius: 18px;
    text-align: right;
}

.ndt-package-description h2 {
    margin: 0 0 12px !important;
    font-size: 19px;
    color: #102a43;
}

.ndt-package-description-content,
.ndt-package-description-content p {
    text-align: right !important;
    line-height: 2;
}

/* Cart */
.ndt-cart-package-badge {
    display: inline-block;
    background: #00b4d8;
    color: #fff;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 10px;
    margin-inline-start: 5px;
}
.ndt-package-locked-qty { font-weight: 700; color: #627d98; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .ndt-package-main-grid {
        grid-template-columns: minmax(300px, 1fr) minmax(270px, .85fr);
    }
    .ndt-package-items-panel {
        grid-column: 1 / -1;
    }
    .ndt-package-products-list-single {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .ndt-packages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .ndt-package-template-wrap { padding: 20px 0 38px; }
    .ndt-package-template-container { padding-inline: 14px; }
    .ndt-package-title-wrap { align-items: flex-start; }
    .ndt-package-page-title { flex-basis: 100%; order: 2; }
    .ndt-package-page-count { order: 3; }
    .ndt-package-main-grid { grid-template-columns: 1fr; gap: 13px; }
    .ndt-package-visual-panel,
    .ndt-package-buy-panel,
    .ndt-package-items-panel { padding: 14px; border-radius: 15px; }
    .ndt-package-visual { min-height: 290px; }
    .ndt-package-visual > img { min-height: 290px; max-height: 360px; padding: 14px; }
    .ndt-package-products-list-single { grid-template-columns: 1fr; }
    .ndt-package-product-row { grid-template-columns: 58px minmax(0, 1fr) auto; min-height: 76px; }
    .ndt-package-product-image { width: 58px; height: 58px; }
    .ndt-package-product-image img { width: 54px !important; height: 54px !important; max-width: 54px !important; }
    .ndt-package-description { padding: 16px; }
}

@media (max-width: 600px) {
    /* v1.0.5: keep the Golden Basket package cards in two columns on phones. */
    .ndt-packages-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1px;
        border-width: 3px;
        border-radius: 14px;
    }

    .ndt-package-card {
        min-width: 0;
        border-radius: 13px;
    }

    .ndt-package-media {
        aspect-ratio: 1 / 1;
    }

    .ndt-package-media > img {
        padding: 8px;
    }

    .ndt-package-badge {
        top: 8px;
        right: 8px;
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding: 0;
        border-radius: 50%;
        font-size: 11px;
        line-height: 1;
    }

    .ndt-package-body {
        padding: 10px 8px 9px;
    }

    .ndt-package-body h3 {
        font-size: 13px;
        line-height: 1.65;
        margin-bottom: 5px;
    }

    .ndt-package-price-box {
        padding: 8px 7px;
        margin-bottom: 9px;
        border-radius: 9px;
    }

    .ndt-package-price-box del {
        font-size: 9px;
        line-height: 1.5;
        white-space: nowrap;
    }

    .ndt-package-price-box strong {
        font-size: clamp(12px, 3.5vw, 15px);
        line-height: 1.55;
        white-space: nowrap;
    }

    .ndt-package-view,
    .ndt-package-add-form button,
    .ndt-package-unavailable {
        min-height: 36px;
        padding: 7px 5px;
        border-radius: 8px;
        font-size: 11px;
        white-space: nowrap;
    }
}


/* v1.0.3 homepage card refinements */
.ndt-package-card .ndt-package-actions { gap: 0; }
.ndt-package-card .ndt-package-view { width: 100%; flex: 1 1 100%; }
.ndt-package-card .ndt-package-saving,
.ndt-package-card .ndt-package-add-form { display: none !important; }

/* =========================================================
   v1.0.4 - Joined golden basket cards + animated gold sweep
   ========================================================= */

/* Desktop: cards connect like a single strip.
   In RTL the first card is the right edge and the last card is the left edge. */
@media (min-width: 1025px) {
    .ndt-packages-grid > .ndt-package-card {
        border-radius: 0;
    }

    .ndt-packages-grid > .ndt-package-card:first-child {
        border-radius: 0 18px 18px 0;
    }

    .ndt-packages-grid > .ndt-package-card:last-child {
        border-radius: 18px 0 0 18px;
    }
}

/* When cards become a vertical/mobile layout, each card is independent again. */
@media (max-width: 1024px) {
    .ndt-packages-grid > .ndt-package-card {
        border-radius: 16px;
    }
}

@media (min-width: 1025px) {
    .ndt-packages-grid > .ndt-package-card:only-child {
        border-radius: 18px;
    }
}

/* Gold light sweep over the decorative "سبد طلایی" artwork beside the packages.
   frontend.js finds the nearby decorative image automatically and adds this host class. */
.ndt-golden-basket-art {
    position: relative !important;
    overflow: hidden;
    isolation: isolate;
}

.ndt-golden-basket-art > img,
.ndt-golden-basket-art picture,
.ndt-golden-basket-art picture img {
    position: relative;
    z-index: 1;
}

.ndt-golden-basket-shine {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    top: 57%;
    bottom: 5%;
    left: -34%;
    width: 22%;
    transform: skewX(-17deg);
    opacity: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 215, 0, 0) 0%,
        rgba(255, 196, 0, .14) 22%,
        rgba(255, 222, 74, .92) 47%,
        rgba(255, 249, 205, .96) 52%,
        rgba(255, 193, 7, .72) 60%,
        rgba(255, 215, 0, 0) 100%
    );
    filter: blur(.2px) drop-shadow(0 0 7px rgba(255, 193, 7, .72));
    mix-blend-mode: screen;
    animation: ndtGoldenBasketSweep 3.8s ease-in-out infinite;
}

.ndt-golden-basket-art::after {
    content: "";
    position: absolute;
    z-index: 3;
    pointer-events: none;
    left: 18%;
    right: 18%;
    bottom: 7%;
    height: 27%;
    border-radius: 50%;
    box-shadow: 0 0 17px rgba(255, 193, 7, .18), inset 0 0 12px rgba(255, 215, 0, .10);
    opacity: .45;
    animation: ndtGoldenBasketGlow 2.6s ease-in-out infinite alternate;
}

@keyframes ndtGoldenBasketSweep {
    0%, 20% { left: -34%; opacity: 0; }
    28% { opacity: .25; }
    45% { opacity: .95; }
    62% { opacity: .28; }
    70%, 100% { left: 116%; opacity: 0; }
}

@keyframes ndtGoldenBasketGlow {
    from { opacity: .22; transform: scale(.98); }
    to { opacity: .55; transform: scale(1.025); }
}

@media (prefers-reduced-motion: reduce) {
    .ndt-golden-basket-shine,
    .ndt-golden-basket-art::after {
        animation: none !important;
    }
    .ndt-golden-basket-shine { display: none; }
}
