/* ─── Themed product stock badges (Pre-order / Out of stock) ─── */

.product-stock-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
    isolation: isolate;
}

.product-stock-badge__label {
    position: relative;
    z-index: 2;
}

/* Inside product card image — top center, away from bottom add-to-cart */
.product-stock-badge--card {
    position: absolute;
    top: 10px;
    left: 50%;
    z-index: 5;
    margin: 0;
    max-width: calc(100% - 20px);
    transform: translateX(-50%);
    white-space: nowrap;
}

.product-card-image:has(.product-stock-badge),
.fashion-product-card__media:has(.product-stock-badge),
.food-tile-card__visual:has(.product-stock-badge),
.store-catalog-card__image:has(.product-stock-badge),
.store-wishlist-card__image:has(.product-stock-badge) {
    overflow: visible;
}

.product-stock-badge--inline {
    position: relative;
    top: auto;
    left: auto;
    display: inline-block;
    margin-bottom: 4px;
    transform: none !important;
}

.product-stock-badge--inline .product-stock-badge__nail,
.product-stock-badge--inline .product-stock-badge__ribbon,
.product-stock-badge--inline .product-stock-badge__bow,
.product-stock-badge--inline .product-stock-badge__string,
.product-stock-badge--inline .product-stock-badge__hole,
.product-stock-badge--inline .product-stock-badge__fold,
.product-stock-badge--inline .product-stock-badge__base {
    display: none;
}

/* ── Theme 1 · Restaurant — wooden sign nailed on ── */
.product-stock-badge--theme1.product-stock-badge--card {
    top: 12px;
    min-width: 92px;
    padding: 7px 16px 8px;
    transform: translateX(-50%) rotate(-1.5deg);
    color: #f8f0e3;
    background:
        repeating-linear-gradient(
            92deg,
            rgba(255, 255, 255, 0.03) 0 2px,
            transparent 2px 7px
        ),
        linear-gradient(180deg, #a47143 0%, #7a4f2c 48%, #5c3a1f 100%);
    border: 1px solid #4a2f18;
    border-radius: 3px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 3px 8px rgba(60, 35, 15, 0.35);
    font-family: Georgia, 'Times New Roman', serif;
}

.product-stock-badge--theme1 .product-stock-badge__nail {
    position: absolute;
    top: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e8e8e8, #6f6f6f 55%, #3a3a3a);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    z-index: 3;
}

.product-stock-badge--theme1 .product-stock-badge__nail--tl { left: 7px; }
.product-stock-badge--theme1 .product-stock-badge__nail--tr { right: 7px; }

.product-stock-badge--theme1.product-stock-badge--out-of-stock {
    filter: grayscale(0.35) brightness(0.92);
}

/* ── Theme 2 · Electronics — glowing status chip ── */
.product-stock-badge--theme2 {
    padding: 5px 12px 5px 22px;
    border-radius: 3px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: #d8fff4;
    background: linear-gradient(180deg, #1a2332 0%, #0d1219 100%);
    border: 1px solid rgba(0, 255, 194, 0.45);
    box-shadow:
        0 0 12px rgba(0, 255, 194, 0.22),
        inset 0 0 8px rgba(0, 255, 194, 0.08);
}

.product-stock-badge--theme2::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #00ffc2;
    box-shadow: 0 0 8px #00ffc2;
    z-index: 1;
}

.product-stock-badge--theme2.product-stock-badge--out-of-stock {
    color: #ffd8d8;
    border-color: rgba(255, 82, 82, 0.55);
    box-shadow:
        0 0 12px rgba(255, 82, 82, 0.2),
        inset 0 0 8px rgba(255, 82, 82, 0.08);
}

.product-stock-badge--theme2.product-stock-badge--out-of-stock::before {
    background: #ff5252;
    box-shadow: 0 0 8px #ff5252;
}

/* ── Theme 3 · Fashion — silk ribbon tag tied on ── */
.product-stock-badge--theme3.product-stock-badge--card {
    top: 16px;
    min-width: 88px;
    padding: 8px 18px 9px;
    color: #1a1a1a;
    background: linear-gradient(180deg, #fffef9 0%, #f3efe6 100%);
    border: 1px solid #d8d0c4;
    border-radius: 1px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
}

.product-stock-badge--theme3 .product-stock-badge__bow {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 14px;
    height: 8px;
    transform: translateX(-50%);
    background: var(--theme-color, #1a1a1a);
    border-radius: 2px 2px 0 0;
    z-index: 3;
}

.product-stock-badge--theme3 .product-stock-badge__bow::before,
.product-stock-badge--theme3 .product-stock-badge__bow::after {
    content: '';
    position: absolute;
    top: 2px;
    width: 9px;
    height: 12px;
    background: var(--theme-color, #1a1a1a);
    border-radius: 50% 50% 0 50%;
}

.product-stock-badge--theme3 .product-stock-badge__bow::before {
    left: -7px;
    transform: rotate(-28deg);
}

.product-stock-badge--theme3 .product-stock-badge__bow::after {
    right: -7px;
    transform: rotate(28deg) scaleX(-1);
}

.product-stock-badge--theme3 .product-stock-badge__ribbon {
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 0;
}

.product-stock-badge--theme3 .product-stock-badge__ribbon--left {
    left: -11px;
    border-width: 10px 11px 10px 0;
    border-color: transparent #c9bfb0 transparent transparent;
    transform: translateY(-50%) rotate(-6deg);
}

.product-stock-badge--theme3 .product-stock-badge__ribbon--right {
    right: -11px;
    border-width: 10px 0 10px 11px;
    border-color: transparent transparent transparent #c9bfb0;
    transform: translateY(-50%) rotate(6deg);
}

.product-stock-badge--theme3.product-stock-badge--pre-order .product-stock-badge__label {
    color: var(--theme-color, #1a1a1a);
}

.product-stock-badge--theme3.product-stock-badge--out-of-stock {
    color: #5c5348;
    background: linear-gradient(180deg, #ece8e1 0%, #ddd6cb 100%);
}

/* ── Theme 4 · Health & Beauty — apothecary bottle label ── */
.product-stock-badge--theme4 {
    padding: 6px 16px;
    border-radius: 999px;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.16em;
    border: 1px solid rgba(255, 255, 255, 0.65);
}

.product-stock-badge--theme4.product-stock-badge--pre-order {
    color: #5f3d4a;
    background: linear-gradient(135deg, #fce8ef 0%, #f5d5e4 100%);
    box-shadow: 0 3px 10px rgba(180, 100, 130, 0.18);
}

.product-stock-badge--theme4.product-stock-badge--pre-order::before {
    content: '✦';
    margin-right: 5px;
    font-size: 8px;
    opacity: 0.75;
}

.product-stock-badge--theme4.product-stock-badge--out-of-stock {
    color: #4a5568;
    background: linear-gradient(135deg, #eef2f7 0%, #dde4ec 100%);
    box-shadow: 0 3px 10px rgba(100, 116, 139, 0.15);
}

/* ── Theme 5 · Retail — string hang tag ── */
.product-stock-badge--theme5.product-stock-badge--card {
    top: 18px;
    min-width: 78px;
    padding: 12px 14px 8px;
    transform: translateX(-50%) rotate(2.5deg);
    color: #1f2937;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    font-family: Arial, Helvetica, sans-serif;
}

.product-stock-badge--theme5 .product-stock-badge__string {
    position: absolute;
    top: -14px;
    left: 50%;
    width: 2px;
    height: 14px;
    transform: translateX(-50%);
    background: #9ca3af;
    border-radius: 1px;
    z-index: 1;
}

.product-stock-badge--theme5 .product-stock-badge__string::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translateX(-50%);
    border: 2px solid #9ca3af;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.product-stock-badge--theme5 .product-stock-badge__hole {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    z-index: 2;
}

.product-stock-badge--theme5.product-stock-badge--pre-order .product-stock-badge__label {
    color: var(--theme-color, #b45309);
}

/* ── Theme 6 · Hospitality — table tent card ── */
.product-stock-badge--theme6.product-stock-badge--card {
    top: 12px;
    min-width: 96px;
    padding: 10px 16px 12px;
    transform: translateX(-50%);
    transform-origin: center top;
    color: #1f2937;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    box-shadow:
        0 1px 0 #fff inset,
        0 14px 20px -10px rgba(15, 23, 42, 0.35),
        0 4px 6px rgba(15, 23, 42, 0.12);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 10px;
    letter-spacing: 0.14em;
}

.product-stock-badge--theme6 .product-stock-badge__fold {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0 15%, #e2e8f0 85%, transparent);
    z-index: 1;
}

.product-stock-badge--theme6 .product-stock-badge__base {
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -6px;
    height: 6px;
    background: rgba(15, 23, 42, 0.12);
    filter: blur(4px);
    border-radius: 50%;
    z-index: 0;
}

.product-stock-badge--theme6.product-stock-badge--pre-order .product-stock-badge__label {
    color: var(--theme-color, #0f766e);
}

/* ── Theme 7 · Modern retail — embossed seal stamp ── */
.product-stock-badge--theme7 {
    padding: 6px 14px;
    border-radius: 2px;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    border: 2px solid currentColor;
}

.product-stock-badge--theme7.product-stock-badge--pre-order {
    color: var(--theme-color, #2563eb);
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(37, 99, 235, 0.2);
}

.product-stock-badge--theme7.product-stock-badge--pre-order::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed currentColor;
    opacity: 0.35;
    pointer-events: none;
}

.product-stock-badge--theme7.product-stock-badge--out-of-stock {
    color: #6b7280;
    background: #f9fafb;
    border-style: dashed;
    opacity: 0.95;
}

/* Cart / inline — compact themed chips */
.cart-left .product-stock-badge--theme1,
.cart-item .product-stock-badge--theme1 {
    padding: 4px 10px;
    background: linear-gradient(180deg, #a47143, #7a4f2c);
    color: #fff;
    border-radius: 3px;
}

.cart-left .product-stock-badge--theme3,
.cart-item .product-stock-badge--theme3 {
    padding: 3px 10px;
    background: #f3efe6;
    color: #1a1a1a;
    border: 1px solid #d8d0c4;
}

.cart-left .product-stock-badge--theme2,
.cart-item .product-stock-badge--theme2 {
    padding: 3px 10px 3px 18px;
    background: #1a2332;
    color: #d8fff4;
    border: 1px solid rgba(0, 255, 194, 0.4);
    border-radius: 3px;
}

@media (max-width: 480px) {
    .product-stock-badge--card {
        top: 8px;
        max-width: calc(100% - 12px);
        font-size: 9px;
    }

    .product-stock-badge--theme3.product-stock-badge--card {
        top: 14px;
    }

    .product-stock-badge--theme5.product-stock-badge--card {
        top: 16px;
    }
}
