/* =========================================================
   ROOT
========================================================= */
:root {
    --gold: #d4af37;
    --dark: #000;
    --gray: #1a1a1a;
    --light-gray: #888;
    --white: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--dark);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* =========================================================
   PRODUCT NAVBAR
========================================================= */
.product-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.back-btn {
    color: var(--white);
    text-decoration: none;
}

.brand {
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 4px;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 18px;
}

.product-nav i {
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
}

/* =========================================================
   CART ICON
========================================================= */
.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-counter {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--gold);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   PRODUCT LAYOUT
========================================================= */
.product-wrapper {
    display: flex;
    flex-direction: column;
}

/* =========================================================
   GALLERY — CORRIGIDO: object-fit contain, sem corte
========================================================= */
.gallery-container {
    width: 100%;
    background: #0d0d0d;
}

.main-display {
    position: relative;
    width: 100%;
    /* Altura fixa para não cortar */
    height: 60vw;
    max-height: 520px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    overflow: hidden;
}

/* AQUI ESTÁ A CORREÇÃO PRINCIPAL — contain em vez de cover */
.main-display img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* ← NÃO CORTA A IMAGEM */
    object-position: center;
    display: block;
    background: #111;
}

.thumb-strip {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    overflow-x: auto;
    background: #0d0d0d;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) #222;
}

.thumb-strip::-webkit-scrollbar {
    height: 4px;
}

.thumb-strip::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 2px;
}

.thumb {
    width: 70px;
    height: 80px;
    object-fit: contain;   /* ← miniaturas também não cortam */
    background: #1a1a1a;
    border-radius: 6px;
    opacity: .5;
    cursor: pointer;
    transition: .3s;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.thumb.active {
    opacity: 1;
    border-color: var(--gold);
}

/* =========================================================
   PRODUCT INFO
========================================================= */
.info-container {
    padding: 25px;
}

.category-tag {
    display: inline-block;
    font-size: 10px;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 4px 10px;
    border-radius: 3px;
    letter-spacing: 1px;
}

.product-header h1 {
    font-size: 28px;
    margin: 15px 0 10px;
    letter-spacing: 1px;
}

.price-main {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.installments {
    color: var(--gold);
    font-size: 14px;
    margin-bottom: 30px;
}

/* =========================================================
   SELECTORS
========================================================= */
.selector-group {
    margin-bottom: 25px;
}

.selector-group label {
    display: block;
    margin-bottom: 12px;
    color: var(--light-gray);
    font-size: 11px;
    letter-spacing: 1px;
}

.color-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: .3s;
}

.dot.active {
    border-color: var(--white);
    transform: scale(1.1);
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-options button {
    width: 50px;
    height: 45px;
    border: 1px solid #333;
    background: transparent;
    color: var(--white);
    font-weight: bold;
    cursor: pointer;
    transition: .3s;
    border-radius: 4px;
}

.size-options button:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.size-options button.selected {
    background: var(--white);
    color: #000;
    border-color: var(--white);
}

/* =========================================================
   BUY BUTTON
========================================================= */
.btn-buy-now {
    width: 100%;
    padding: 20px;
    margin: 20px 0;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #d4af37, #b8962e);
    color: #000;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: .3s;
}

.btn-buy-now:hover {
    transform: translateY(-2px);
    opacity: .95;
}

/* =========================================================
   PRODUCT DESCRIPTION
========================================================= */
.product-specs details {
    padding: 15px 0;
    border-top: 1px solid #222;
}

.product-specs summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

.product-specs summary::after {
    content: '+';
    color: var(--gold);
}

.product-specs details[open] summary::after {
    content: '-';
}

.product-specs p {
    margin-top: 10px;
    color: #bbb;
    font-size: 14px;
    line-height: 1.6;
}

/* =========================================================
   CART SIDEBAR (no produto.html, tema escuro)
========================================================= */
.cart-sidebar {
    background: #111 !important;
    color: #fff !important;
}

.cart-sidebar h2,
.cart-sidebar h3,
.cart-sidebar h4,
.cart-sidebar p,
.cart-sidebar small,
.cart-sidebar label {
    color: #fff !important;
}

.cart-checkout-form {
    background: #1a1a1a !important;
}

.cart-checkout-form input,
.cart-checkout-form select {
    background: #0d0d0d !important;
    border: 1px solid #444 !important;
    color: #fff !important;
}

.cart-checkout-form input::placeholder {
    color: #777 !important;
}

/* =========================================================
   DESKTOP — galeria ao lado
========================================================= */
@media (min-width: 992px) {
    .product-wrapper {
        flex-direction: row;
        gap: 50px;
        max-width: 1200px;
        margin: 40px auto;
        padding: 0 20px;
    }

    .gallery-container {
        width: 55%;
        position: sticky;
        top: 100px;
        height: fit-content;
        background: transparent;
    }

    .main-display {
        height: 70vh;
        max-height: 680px;
        border-radius: 10px;
        overflow: hidden;
    }

    .info-container {
        width: 45%;
    }

    .product-header h1 {
        font-size: 42px;
    }
}

/* =========================================================
   TABLET
========================================================= */
@media (max-width: 768px) {
    .product-nav {
        padding: 16px;
    }

    .brand {
        font-size: 14px;
    }

    .main-display {
        height: 70vw;
        max-height: 360px;
    }

    .info-container {
        padding: 20px;
    }

    .product-header h1 {
        font-size: 22px;
    }

    .price-main {
        font-size: 22px;
    }

    .btn-buy-now {
        padding: 18px;
        font-size: 14px;
    }
}

/* =========================================================
   MOBILE PEQUENO
========================================================= */
@media (max-width: 480px) {
    .main-display {
        height: 80vw;
        max-height: 300px;
    }

    .thumb {
        width: 56px;
        height: 64px;
    }
}

/* =========================================================
   iOS ESPECÍFICO — Detecta Safari no iOS
========================================================= */
@supports (-webkit-touch-callout: none) {
    /* Aqui entra APENAS em iOS */
    .product-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding-bottom: 20px;
    }

    .gallery-container {
        width: 100%;
        position: relative;
        top: auto;
        height: auto;
        margin-bottom: 15px;
        background: #0d0d0d;
    }

    .main-display {
        height: 60vh;
        max-height: 320px;
        border-radius: 0;
        width: 100%;
    }

    .info-container {
        width: 100%;
        padding: 20px;
        padding-bottom: 120px;
        position: relative;
    }

    .product-header h1 {
        font-size: 18px;
        margin: 10px 0 8px;
    }

    .price-main {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .btn-buy-now {
        padding: 16px;
        font-size: 13px;
        margin: 15px 0;
        width: 100%;
    }

    .selector-group {
        margin-bottom: 16px;
    }

    .size-options button {
        width: 45px;
        height: 40px;
        font-size: 11px;
    }

    /* Evitar zoom no iOS */
    input, select, textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }

    .cart-checkout-form input,
    .cart-checkout-form select {
        font-size: 16px !important;
    }
}
/* Impedir zoom automático no iOS */
input, select, textarea {
    font-size: 16px !important;
}

input:focus, select:focus, textarea:focus {
    font-size: 16px !important;
}