/* === Out of Stock Banner === */
.out-of-stock-banner {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
}

.out-of-stock-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.out-of-stock-banner-content i {
    color: #ef4444;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.light-theme .out-of-stock-banner {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.light-theme .out-of-stock-banner-content i {
    color: #dc2626;
}

/* === Stock Notification Subscription Form === */
.stock-notification-form {
    margin-top: 12px;
    padding: 16px;
    background: rgba(229, 32, 86, 0.08);
    border: 1px solid rgba(229, 32, 86, 0.22);
    border-radius: 8px;
}

.stock-notification-form .notification-form-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-light, #ff2d6a);
}

.stock-notification-form .notification-form-header i {
    color: var(--accent);
    font-size: 1rem;
}

.stock-notification-form .notification-form-description {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 12px;
}

.stock-notification-form .notification-form-fields {
    display: flex;
    gap: 8px;
}

.stock-notification-form .notification-email-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.stock-notification-form .notification-email-input::placeholder {
    color: #64748b;
}

.stock-notification-form .notification-email-input:focus {
    border-color: var(--accent);
}

.stock-notification-form .notification-submit-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stock-notification-form .notification-submit-btn:hover {
    background: var(--accent-hover, #c41847);
}

.stock-notification-form .notification-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.stock-notification-form .notification-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: none;
}

.stock-notification-form .notification-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.stock-notification-form .notification-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Light theme overrides for stock notification form */
.light-theme .stock-notification-form {
    background: rgba(229, 32, 86, 0.05);
    border-color: rgba(229, 32, 86, 0.18);
}

.light-theme .stock-notification-form .notification-form-header {
    color: #b91c4a;
}

.light-theme .stock-notification-form .notification-form-header i {
    color: var(--accent);
}

.light-theme .stock-notification-form .notification-form-description {
    color: #64748b;
}

.light-theme .stock-notification-form .notification-email-input {
    background: #fff;
    border-color: #e2e8f0;
    color: #1e293b;
}

.light-theme .stock-notification-form .notification-email-input::placeholder {
    color: #94a3b8;
}

.light-theme .stock-notification-form .notification-message.success {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.2);
    color: #15803d;
}

.light-theme .stock-notification-form .notification-message.error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

@media (max-width: 480px) {
    .stock-notification-form .notification-form-fields {
        flex-direction: column;
    }

    .stock-notification-form .notification-submit-btn {
        justify-content: center;
    }
}

/* === Disabled Quantity Controls === */
.product-quantity.disabled-controls {
    opacity: 0.5;
    pointer-events: none;
}

/* === Disabled Add to Cart Button === */
.add-to-cart[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    background: #6b7280 !important;
    border-color: #6b7280 !important;
}

.add-to-cart[disabled]:hover {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
    transform: none !important;
}

/* === Warehouse Stock Section (compact redesign) === */
.warehouse-stock-card {
    margin-top: 24px;
    margin-bottom: 24px;
    background: var(--wh-bg, #0d0d0d);
    border: 1px solid var(--wh-border, #1f1f1f);
    border-radius: 16px;
    padding: 20px 22px;
    color: var(--wh-text, #e2e8f0);
}

.warehouse-stock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.warehouse-stock-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--wh-heading, #f8fafc);
}

.warehouse-stock-title i {
    color: var(--accent);
    font-size: 0.95rem;
}

.warehouse-stock-subtitle {
    color: var(--wh-muted, #94a3b8);
    font-size: 0.85rem;
    margin-top: 2px;
}

.warehouse-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.warehouse-total-badge i { font-size: 0.9rem; }

.warehouse-total-badge--success {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.warehouse-total-badge--out {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Compact status grid: fluid on tablet/desktop, single-column on mobile */
.warehouse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 9px;
}

.warehouse-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: var(--wh-card, #141414);
    border: 1px solid var(--wh-card-border, #242424);
    border-radius: 12px;
    padding: 11px 13px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.warehouse-card:hover { transform: translateY(-1px); }

/* Status-colored border + soft tinted background */
.warehouse-card.ok {
    border-color: var(--wh-ok-border, rgba(34, 197, 94, 0.45));
    background: var(--wh-ok-bg, rgba(34, 197, 94, 0.07));
}
.warehouse-card.low {
    border-color: var(--wh-low-border, rgba(249, 115, 22, 0.5));
    background: var(--wh-low-bg, rgba(249, 115, 22, 0.08));
}
.warehouse-card.empty {
    border-color: var(--wh-empty-border, rgba(239, 68, 68, 0.4));
    background: var(--wh-empty-bg, rgba(239, 68, 68, 0.06));
}

.wh-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
    background: #64748b;
}

.warehouse-card.ok    .wh-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.warehouse-card.low   .wh-dot { background: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2); }
.warehouse-card.empty .wh-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }

.wh-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--wh-heading, #f1f5f9);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wh-num {
    flex-shrink: 0;
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--wh-heading, #e0f2fe);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    white-space: nowrap;
}

.wh-num-unit {
    font-weight: 600;
    font-size: 0.68rem;
    color: var(--wh-muted, #94a3b8);
}

.warehouse-card.empty .wh-name,
.warehouse-card.empty .wh-num { color: var(--wh-muted, #94a3b8); }

.warehouse-card.is-selected {
    border-color: var(--accent, #E52056) !important;
    box-shadow: 0 0 0 1px var(--accent, #E52056), 0 4px 14px rgba(229, 32, 86, 0.18);
}

.selected-badge {
    color: var(--accent, #E52056);
    font-size: 0.7rem;
    font-weight: 700;
}

/* Legend */
.warehouse-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px dashed var(--wh-card-border, #242424);
}

.wh-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wh-muted, #94a3b8);
}

.wh-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wh-legend-dot.ok    { background: #22c55e; }
.wh-legend-dot.low   { background: #f97316; }
.wh-legend-dot.empty { background: #ef4444; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Light theme overrides */
.light-theme .warehouse-stock-card {
    --wh-bg: #ffffff;
    --wh-border: #e9edf3;
    --wh-text: #334155;
    --wh-heading: #0f172a;
    --wh-muted: #64748b;
    --wh-card: #f7f9fc;
    --wh-card-border: #e6eaf0;
    --wh-ok-border: rgba(22, 163, 74, 0.4);
    --wh-ok-bg: rgba(22, 163, 74, 0.07);
    --wh-low-border: rgba(234, 88, 12, 0.45);
    --wh-low-bg: rgba(234, 88, 12, 0.08);
    --wh-empty-border: rgba(220, 38, 38, 0.35);
    --wh-empty-bg: rgba(220, 38, 38, 0.06);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

.light-theme .warehouse-total-badge--success {
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.28);
}

.light-theme .warehouse-total-badge--out {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.25);
}

.light-theme .warehouse-card.ok    .wh-dot { background: #16a34a; }
.light-theme .warehouse-card.low   .wh-dot { background: #ea580c; }
.light-theme .warehouse-card.empty .wh-dot { background: #dc2626; }
.light-theme .wh-legend-dot.ok    { background: #16a34a; }
.light-theme .wh-legend-dot.low   { background: #ea580c; }
.light-theme .wh-legend-dot.empty { background: #dc2626; }

/* Tablet: a touch wider minimum so 2-line names breathe */
@media (max-width: 992px) {
    .warehouse-grid { grid-template-columns: repeat(auto-fill, minmax(48%, 1fr)); }
}

@media (max-width: 768px) {
    .warehouse-stock-card { padding: 16px; border-radius: 14px; }
    .warehouse-stock-header { margin-bottom: 12px; }
    .warehouse-grid { grid-template-columns: 1fr; gap: 8px; }
    .warehouse-card:hover { transform: none; }
}
/* === Product Description HTML Content === */
.product-description-html {
    line-height: 1.7;
    color: inherit;
}
.product-description-html h2,
.product-description-html h3,
.product-description-html h4 {
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    font-weight: 600;
}
.product-description-html p {
    margin-bottom: 0.8em;
}
.product-description-html ul,
.product-description-html ol {
    margin-left: 1.5em;
    margin-bottom: 0.8em;
}
.product-description-html li {
    margin-bottom: 0.3em;
}
.product-description-html img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}
.product-description-html table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.product-description-html th,
.product-description-html td {
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 8px 12px;
    text-align: left;
}
.product-description-html blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    opacity: 0.9;
}
.product-description-html a {
    color: var(--accent);
    text-decoration: underline;
}
