.item-page-wrapper {
    width: 90%;
    max-width: var(--content-max);
    margin: 24px auto 60px;
}

.item-breadcrumb {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.item-breadcrumb a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color .15s;
}

.item-breadcrumb a:hover { color: var(--blue-mid); }
.item-breadcrumb .sep    { color: var(--gray-400); }
.item-breadcrumb .current { color: var(--gray-900); font-weight: 600; }

.item-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: rgba(255,255,255,.92);
    border: 1px solid #d7e4f1;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    align-items: start;
}

.item-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gallery-main-frame {
    position: relative;
    aspect-ratio: 1 / 1;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.gallery-main-frame .gallery {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    height: 100%;
}

.gallery-main-frame .gallery::-webkit-scrollbar { display: none; }

.gallery-main-frame .gallery img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    box-sizing: border-box;
    transition: transform .25s;
}

.gallery-main-frame .nav {
    all: unset;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow-sm);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 2;
    color: var(--blue);
    font-size: 1.3rem;
    opacity: 0;
    transition: opacity .18s, background .18s, color .18s;
}

.gallery-main-frame:hover .nav { opacity: 1; }
.gallery-main-frame .nav:hover { background: var(--orange); color: #fff; }
.gallery-main-frame .nav.left  { left: 10px; }
.gallery-main-frame .nav.right { right: 10px; }

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
    flex: 0 0 64px;
    height: 64px;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--gray-50);
    cursor: pointer;
    opacity: .6;
    transition: border-color .18s, opacity .18s;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
}

.gallery-thumb:hover,
.gallery-thumb.active { border-color: var(--orange); opacity: 1; }

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
}

.gallery-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    border: none;
    background: var(--gray-200);
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s, width .2s;
}

.gallery-dot.active {
    background: var(--orange);
    transform: scale(1.15);
    width: 20px;
    border-radius: 4px;
}

.item-info { display: flex; flex-direction: column; padding-top: 4px; }

.item-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue-mid);
    background: var(--blue-light);
    padding: 4px 10px;
    border-radius: var(--r-full);
    margin-bottom: 12px;
    width: fit-content;
}

.item-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--gray-900);
    margin: 0 0 6px;
    letter-spacing: .2px;
}

.item-sku {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 18px;
    letter-spacing: .04em;
}

.item-price-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.item-price {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--blue);
    line-height: 1;
}

.item-price-original {
    font-size: 1rem;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 400;
}

.item-price-badge {
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-full);
}

.item-stock-line {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.stock-dot.low { background: var(--orange); }
.stock-dot.out { background: var(--red); }

.item-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.item-description-block h4 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin: 0 0 6px;
}

.item-description-block p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-600);
    margin: 0;
}

.variants-container { margin: 4px 0 8px; }

.variant-group { margin-bottom: 16px; }

.variant-group-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gray-900);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.variant-group-label .selected-val {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--blue-mid);
}

.variant-bubbles { display: flex; flex-wrap: wrap; gap: 7px; }

.variant-bubble {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
    background: var(--white);
    color: var(--gray-900);
    transition: background .15s, border-color .15s, color .15s, transform .1s;
}

.variant-bubble:hover:not(.disabled) {
    border-color: var(--blue-mid);
    background: var(--blue-light);
    color: var(--blue);
}

.variant-bubble.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    box-shadow: 0 4px 12px rgba(26,58,107,.25);
}

.variant-bubble.is-color {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: 50%;
    position: relative;
}

.variant-bubble.is-color.active {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--blue);
}

.variant-bubble.is-color.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    font-size: 13px;
    background: rgba(0,0,0,.2);
    border-radius: 50%;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

.variant-bubble.disabled {
    opacity: .35;
    pointer-events: none;
    text-decoration: line-through;
}

.item-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-top: 20px;
}

.qty-selector {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--white);
    flex-shrink: 0;
}

.qty-btn {
    all: unset;
    width: 38px; height: 48px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--gray-600);
    transition: background .15s, color .15s;
}

.qty-btn:hover { background: var(--gray-100); color: var(--blue); }

#item-qty {
    width: 40px; height: 48px;
    text-align: center;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    background: transparent;
    appearance: textfield;
    -moz-appearance: textfield;
}

#item-qty::-webkit-outer-spin-button,
#item-qty::-webkit-inner-spin-button { -webkit-appearance: none; }

#buy-item-btn {
    flex: 1;
    height: 48px;
    background: linear-gradient(135deg, var(--blue), var(--blue-mid));
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: box-shadow .18s, transform .1s;
    box-shadow: 0 6px 16px rgba(26,58,107,.22);
}

#buy-item-btn:hover {
    box-shadow: 0 10px 24px rgba(26,58,107,.32);
    transform: translateY(-1px);
}

#buy-item-btn:active { transform: scale(.97); }

#cart-btn {
    width: 48px; height: 48px;
    flex-shrink: 0;
    background: var(--orange-light);
    border: 1.5px solid #f4c49a;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    overflow: visible !important;
    transition: background .18s, border-color .18s, transform .1s, box-shadow .18s;
}

.cart-btn-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
    line-height: 1;
}

#cart-btn:hover {
    background: var(--orange);
    border-color: var(--orange);
    box-shadow: 0 8px 20px rgba(244,119,33,.35);
}

#cart-btn:hover img { filter: brightness(0) invert(1); }
#cart-btn:active    { transform: scale(.92); }

#cart-btn img {
    width: 20px; height: 20px;
    filter: saturate(0) brightness(.4);
    transition: filter .18s;
}

.related-section {
    margin-top: 28px;
    background: rgba(255,255,255,.92);
    border: 1px solid #d7e4f1;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px 32px;
}

.related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.related-header h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: .3px;
    margin: 0;
    position: relative;
    padding-left: 14px;
}

.related-header h2::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 18px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--orange), var(--blue-mid));
}

.related-header a {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-mid);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--r-full);
    border: 1.5px solid var(--blue-mid);
    transition: background .18s, color .18s;
}

.related-header a:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.related-grid .product {
    flex: 1 1 180px;
    max-width: 220px;
}

.skeleton-card {
    flex: 1 1 180px;
    max-width: 220px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2eaf4;
}

.skeleton-img  { aspect-ratio: 1; width: 100%; }

.skeleton-body {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 900px) {
    .item-page-wrapper { width: 100%; margin: 16px auto 40px; }

    .item-main {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .related-section {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 20px 16px;
    }

    .related-grid .product,
    .skeleton-card { flex: 1 1 calc(50% - 10px); max-width: calc(50% - 10px); }
}

@media (max-width: 500px) {
    .item-actions  { flex-wrap: wrap; justify-content: center; }
    #buy-item-btn  { flex: 1 1 100%; order: -1; }
    .qty-selector  { flex: 0 0 auto; }
    .qty-btn       { width: 32px; height: 40px; font-size: 16px; }
    #item-qty      { width: 34px; height: 40px; font-size: 14px; }
    #cart-btn      { flex: 0 0 48px; }
    .item-breadcrumb { display: none; }
}
