/**
 * Alami Theme - Product Page (UI sample layout)
 */

.alami-product {
    background-color: var(--background);
}

/* ── Overview ── */
.alami-product-overview {
    padding: 3rem 0;
}

.alami-product-overview-grid {
    display: grid;
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .alami-product-overview-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 2.5rem;
    }

    .alami-product-gallery-col {
        grid-column: span 5;
    }

    .alami-product-info-col {
        grid-column: span 7;
    }
}

.alami-product-gallery {
    display: flex;
    flex-direction: column;
}

/* Gallery */
.alami-product-gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    background-color: #fff;
    overflow: hidden;
}

.alami-product-gallery-main-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.alami-product-gallery-zoom-hint {
    display: none;
}

/* Gallery zoom modal — xl images load on demand */
.alami-gallery-zoom-stage {
    position: relative;
}

.alami-gallery-zoom-image {
    transition: opacity 0.2s ease;
}

.alami-gallery-zoom-image.is-hidden {
    opacity: 0;
}

.alami-gallery-zoom-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.alami-gallery-zoom-modal.is-loading .alami-gallery-zoom-loading {
    display: flex;
}

.alami-gallery-zoom-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: alami-gallery-zoom-spin 0.7s linear infinite;
}

@keyframes alami-gallery-zoom-spin {
    to {
        transform: rotate(360deg);
    }
}

.alami-product-gallery-videos {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.alami-product-gallery-video-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s, opacity 0.2s;
    line-height: 0;
    flex-shrink: 0;
}

.alami-product-gallery-video-btn .alami-product-gallery-video-icon {
    display: block;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.18));
}

.alami-product-gallery-video-btn--upload .alami-product-gallery-video-icon {
    color: rgba(47, 58, 52, 0.92);
    object-fit: contain;
}

.alami-product-gallery-video-btn--youtube .alami-product-gallery-video-icon {
    color: #ff0000;
}

.alami-product-gallery-video-btn--aparat .alami-product-gallery-video-icon {
    color: #ed145b;
}

.alami-product-gallery-video-btn:hover {
    transform: scale(1.06);
    opacity: 0.92;
}

.alami-product-gallery-thumbs-wrap {
    margin-top: 0.75rem;
}

/* Tablet: vertical thumbs on the left of main image (RTL: column 2 = physical left) */
@media (min-width: 768px) and (max-width: 1023px) {
    .alami-product-gallery {
        display: grid;
        grid-template-columns: 1fr 90px;
        gap: 0.75rem;
        align-items: stretch;
    }

    .alami-product-gallery-main {
        grid-column: 1;
        grid-row: 1;
    }

    .alami-product-gallery-thumbs-wrap {
        grid-column: 2;
        grid-row: 1;
        margin-top: 0;
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .alami-gallery-thumbs-swiper {
        width: 90px;
        height: 100%;
        flex: 1;
        min-height: 0;
    }

    .alami-gallery-thumbs-swiper .swiper-slide {
        width: 90px !important;
        height: 90px !important;
        min-width: 90px;
        min-height: 90px;
    }

    .alami-product-gallery-thumbs-wrap .alami-product-gallery-thumb {
        width: 90px !important;
        height: 90px !important;
        min-width: 90px;
        min-height: 90px;
    }
}

.alami-gallery-thumbs-swiper {
    overflow: hidden;
}

.alami-gallery-thumbs-swiper .swiper-wrapper {
    display: flex;
}

.alami-gallery-thumbs-swiper .swiper-slide {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.alami-product-gallery-thumb {
    position: relative;
    display: block;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background-color: #fff;
    overflow: hidden;
    transition: border-color 0.2s, border-width 0.2s;
    cursor: pointer;
    box-sizing: border-box;
}

/* Tablet + desktop: 90×90 */
@media (min-width: 768px) {
    .alami-gallery-thumbs-swiper .swiper-slide,
    .alami-product-gallery-thumb {
        width: 90px;
        height: 90px;
        min-width: 90px;
        min-height: 90px;
        max-width: 90px;
        max-height: 90px;
    }
}

.alami-product-gallery-thumb.is-active {
    border: 2px solid var(--accent);
}

.alami-product-gallery-thumb img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Video modal */
.alami-product-video-modal {
    display: none;
}

.alami-product-video-modal.is-open {
    display: flex;
}

.alami-product-video-modal-panel {
    border-radius: 1rem;
    overflow: hidden;
    background-color: #111;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.alami-product-video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background-color: #1a1a1a;
    color: #fff;
}

.alami-product-video-modal-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.alami-product-video-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.alami-product-video-modal-body {
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.alami-product-video-modal-body iframe,
.alami-product-video-modal-body video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.alami-product-gallery-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--secondary);
    color: var(--primary);
    pointer-events: none;
}

/* ── Product info ── */
.alami-product-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.alami-product-brand {
    display: block;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.alami-product-title {
    margin: 0.25rem 0 0;
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--foreground);
}

.alami-product-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background-color: var(--card);
    color: var(--muted-foreground);
    transition: color 0.2s;
    flex-shrink: 0;
}

.alami-product-icon-btn:hover {
    color: var(--accent);
}

.alami-product-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.alami-product-meta-sep {
    color: var(--border);
}

.alami-product-meta-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.alami-product-meta-rating .is-accent {
    color: var(--accent);
}

.alami-product-meta-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--accent);
}

.alami-product-meta-muted {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--muted-foreground);
}

.alami-product-lead {
    margin: 0 0 1.5rem;
    line-height: 1.8;
    color: var(--muted-foreground);
}

.alami-product-highlights {
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.alami-product-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
    line-height: 1.7;
}

.alami-product-highlights li:last-child {
    margin-bottom: 0;
}

.alami-product-highlights .is-accent {
    margin-top: 0.125rem;
    flex-shrink: 0;
    color: var(--accent);
}

/* Buy box */
.alami-product-buybox {
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background-color: var(--card);
}

.alami-product-buybox-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.alami-product-price-old {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    text-decoration: line-through;
    color: var(--muted-foreground);
}

.alami-product-price-current {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
}

.alami-product-price-current small {
    font-size: 0.875rem;
    font-weight: 400;
}

.alami-product-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background-color: var(--background);
}

.alami-product-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 0.2s;
}

.alami-product-qty-btn:hover:not(:disabled) {
    background-color: var(--secondary);
}

.alami-product-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.alami-product-qty-value {
    width: 2.5rem;
    text-align: center;
    font-weight: 600;
}

.alami-product-buybox-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .alami-product-buybox-actions {
        flex-direction: row;
    }
}

.alami-product-add-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.alami-product-add-btn.btn-cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alami-product-consult-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background-color: var(--background);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow 0.2s;
}

.alami-product-consult-btn:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.alami-product-shipping-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Cart qty controls (after add) */
.alami-product-cart-controls .alami-qty-controls {
    display: inline-flex;
    align-items: center;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    max-width: 12.5rem;
}

.alami-product-cart-controls .alami-cart-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background-color: var(--accent);
    color: var(--accent-foreground);
    cursor: pointer;
    transition: background-color 0.2s;
}

.alami-product-cart-controls .alami-cart-qty-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.alami-product-cart-controls .alami-cart-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alami-product-cart-controls .alami-cart-qty-value {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #fff;
}

/* Variations inside buy box */
.alami-product-variations {
    margin-bottom: 1.25rem;
}

.alami-product-variations-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.alami-product-variations .variation-value-btn.is-selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ── Delivery perks ── */
.alami-product-perks {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background-color: var(--card);
}

.alami-product-perks-grid {
    display: grid;
    gap: 1.5rem;
    padding: 2rem 0;
}

@media (min-width: 640px) {
    .alami-product-perks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .alami-product-perks-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.alami-product-perk {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alami-product-perk-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    flex-shrink: 0;
    background-color: var(--secondary);
    color: var(--primary);
}

.alami-product-perk-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.alami-product-perk-desc {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--muted-foreground);
}

/* ── Tabs + sidebar ── */
.alami-product-details {
    padding: 4rem 0;
}

.alami-product-details-grid {
    display: grid;
    gap: 2.5rem;
    align-items: start;
    min-width: 0;
}

@media (min-width: 1024px) {
    .alami-product-details-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .alami-product-tabs-col {
        grid-column: span 8;
    }

    .alami-product-sidebar-col {
        grid-column: span 4;
    }
}

.alami-product-tabs-col,
.alami-product-sidebar-col {
    min-width: 0;
}

.alami-product-tabs-card {
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    background-color: var(--card);
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.alami-product-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
}

.alami-product-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* Desktop: thin scrollbar + wheel scroll (see product-detail-core.js) */
@media (hover: hover) and (pointer: fine) {
    .alami-product-tabs-nav {
        scrollbar-width: thin;
        scrollbar-color: var(--border) transparent;
    }

    .alami-product-tabs-nav::-webkit-scrollbar {
        display: block;
        height: 4px;
    }

    .alami-product-tabs-nav::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 9999px;
    }

    .alami-product-tabs-nav::-webkit-scrollbar-thumb:hover {
        background: var(--primary);
    }
}

.alami-product-tabs-nav .tab-btn {
    position: relative;
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: color 0.2s;
}

.alami-product-tabs-nav .tab-btn.is-active {
    color: var(--primary);
}

.alami-product-tabs-nav .tab-btn.is-active::after {
    content: '';
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    height: 2px;
    border-radius: 9999px;
    background-color: var(--accent);
}

.alami-product-tabs-body {
    padding: 1.75rem;
}

@media (max-width: 767px) {
    .alami-product-details {
        padding: 2.5rem 0;
    }

    .alami-product-tabs-nav .tab-btn {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
    }

    .alami-product-tabs-body {
        padding: 1.25rem;
    }
}

.alami-product-tab-prose {
    line-height: 2;
    color: var(--muted-foreground);
}

.alami-product-tab-prose p {
    margin-bottom: 0.75em;
}

.alami-product-tab-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.alami-product-ingredients-table {
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.alami-product-ingredients-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
}

.alami-product-ingredients-row:nth-child(odd) {
    background-color: var(--background);
}

.alami-product-ingredients-row:nth-child(even) {
    background-color: var(--card);
}

.alami-product-ingredients-row span:last-child {
    color: var(--muted-foreground);
}

.alami-product-usage-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .alami-product-usage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.alami-product-usage-grid h3 {
    margin: 0 0 1rem;
    font-weight: 700;
    color: var(--foreground);
}

.alami-product-usage-steps {
    margin: 0;
    padding: 0;
    list-style: none;
}

.alami-product-usage-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.7;
}

.alami-product-usage-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: var(--secondary);
    color: var(--primary);
}

.alami-product-review-card {
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background-color: var(--background);
}

.alami-product-review-card + .alami-product-review-card {
    margin-top: 1rem;
}

.alami-product-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.alami-product-review-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alami-product-review-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 700;
    background-color: var(--secondary);
    color: var(--primary);
}

.alami-product-review-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
}

.alami-product-review-meta {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.alami-product-review-stars {
    display: inline-flex;
    gap: 0.125rem;
    color: var(--accent);
}

.alami-product-review-quote {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--muted-foreground);
}

/* Sidebar */
.alami-product-specs-card,
.alami-product-consult-card {
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
}

.alami-product-specs-card {
    background-color: var(--card);
}

.alami-product-specs-card h2,
.alami-product-consult-card h2 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.alami-product-specs-list {
    margin: 0;
}

.alami-product-specs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

.alami-product-specs-row:first-child {
    border-top: none;
    padding-top: 0;
}

.alami-product-specs-row dt {
    color: var(--muted-foreground);
}

.alami-product-specs-row dd {
    margin: 0;
    font-weight: 500;
    text-align: left;
}

.alami-product-consult-card {
    margin-top: 1.25rem;
    background-color: var(--secondary);
}

.alami-product-consult-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    background-color: var(--card);
    color: var(--primary);
}

.alami-product-consult-card p {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--muted-foreground);
}

.alami-product-consult-card .btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

/* ── Related ── */
.alami-product-related {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    background-color: var(--card);
}

.alami-product-related-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.alami-product-related-kicker {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--secondary);
    color: var(--primary);
}

.alami-product-related-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.alami-product-related-link {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.alami-product-related-link:hover {
    color: var(--accent);
}

@media (min-width: 640px) {
    .alami-product-related-link {
        display: inline-flex;
    }
}

.alami-product-related-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .alami-product-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .alami-product-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile bottom bar */
.alami-product-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    width: 100%;
    background-color: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 768px) {
    .alami-product-mobile-bar {
        display: none;
    }
}

@media (max-width: 767px) {
    body:has([data-product-mobile-bar]) .alami-footer {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    }
}

.alami-product-mobile-bar .alami-product-qty {
    flex-shrink: 0;
}

.alami-product-mobile-bar .alami-qty-controls {
    display: inline-flex;
    align-items: center;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}

.alami-product-mobile-bar .alami-cart-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.alami-product-mobile-bar .alami-add-to-cart-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    background-color: var(--accent);
    color: var(--accent-foreground);
    font-size: 0.875rem;
    font-weight: 600;
}

.alami-product-mobile-bar .alami-add-to-cart-btn:disabled {
    opacity: 0.5;
}

/* ── Tab extras: FAQ, Q&A, reviews toolbar ── */
.alami-product-tab-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.alami-product-tab-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background-color: var(--accent);
    color: var(--accent-foreground);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.alami-product-tab-action-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.alami-product-tab-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alami-product-tab-notice {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #fcd34d;
    background-color: #fffbeb;
    font-size: 0.75rem;
    line-height: 1.7;
    color: #92400e;
}

.alami-product-tab-notice a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

.alami-product-tab-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alami-product-tab-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.alami-product-tab-badge.is-success {
    border: 1px solid #a7f3d0;
    background-color: #ecfdf5;
    color: #065f46;
}

.alami-product-tab-badge.is-warning {
    border: 1px solid #fde68a;
    background-color: #fffbeb;
    color: #92400e;
}

.alami-product-faq-panel {
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.alami-product-faq-item {
    border-bottom: 1px solid var(--border);
}

.alami-product-faq-item:last-child {
    border-bottom: none;
}

.alami-product-faq-item[open] {
    background-color: color-mix(in srgb, var(--secondary) 35%, var(--card));
}

.alami-product-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--foreground);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.alami-product-faq-question::-webkit-details-marker {
    display: none;
}

.alami-product-faq-chevron {
    flex-shrink: 0;
    color: var(--muted-foreground);
    transition: transform 0.2s, color 0.2s;
}

.alami-product-faq-item[open] .alami-product-faq-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.alami-product-faq-answer {
    padding: 0 1.25rem 1.125rem;
}

.alami-product-faq-answer p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.85;
    color: var(--muted-foreground);
}

.alami-product-questions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alami-product-question-card {
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background-color: var(--background);
}

.alami-product-question-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.alami-product-question-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--foreground);
}

.alami-product-question-answer {
    margin-top: 0.875rem;
    padding: 0.875rem 1rem;
    border-right: 3px solid var(--accent);
    border-radius: 0.75rem;
    background-color: color-mix(in srgb, var(--secondary) 50%, var(--card));
}

.alami-product-question-answer-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

.alami-product-question-answer p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--foreground);
}

.alami-product-question-pending {
    margin: 0.875rem 0 0;
    font-size: 0.75rem;
    color: #92400e;
}
