/* ===========================
   JOYERÍA ÉLITE — MAISON DESIGN
   Aesthetic: Editorial Luxury
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ===========================
   DESIGN TOKENS
   =========================== */

:root {
    --ivory:      #F9F5EE;
    --cream:      #FDFAF4;
    --obsidian:   #1A1410;
    --espresso:   #2E2620;
    --gold:       #9A7535;
    --gold-light: #C4A05A;
    --gold-pale:  #E8D9B8;
    --stone:      #DDD5C8;
    --mist:       #EDE8DF;
    --smoke:      #7A6E62;
    --ink:        #3D342A;

    --success:    #3D6B4F;
    --error:      #8B3030;
    --warning:    #7A5C20;

    --shadow-xs:  0 1px 3px rgba(26,20,16,.07);
    --shadow-sm:  0 2px 12px rgba(26,20,16,.09);
    --shadow-md:  0 6px 24px rgba(26,20,16,.13);
    --shadow-lg:  0 16px 48px rgba(26,20,16,.18);

    --ease:       cubic-bezier(.4,0,.2,1);
    --transition: all .3s var(--ease);
    --transition-slow: all .6s var(--ease);

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;

    --max-width: 1440px;
    --gutter: 2.5rem;
}

/* ===========================
   RESET & BASE
   =========================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    color: var(--ink);
    background: var(--ivory);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===========================
   TYPOGRAPHY
   =========================== */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
    color: var(--obsidian);
    letter-spacing: .02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 300; }
h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 300; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

p {
    font-weight: 300;
    color: var(--smoke);
}

strong {
    font-weight: 500;
    color: var(--ink);
}

/* ===========================
   HEADER & NAV
   =========================== */

header {
    background: var(--obsidian);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(196,160,90,.15);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 400;
    letter-spacing: .12em;
    color: var(--gold-light);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-brand span {
    color: rgba(196,160,90,.5);
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: .06em;
    margin-left: .5rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: .25rem;
    align-items: center;
}

nav ul li a {
    color: rgba(253,250,244,.72);
    font-size: .82rem;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .55rem 1rem;
    border-radius: 3px;
    transition: var(--transition);
    white-space: nowrap;
    display: block;
}

nav ul li a:hover {
    color: var(--gold-light);
    background: rgba(196,160,90,.08);
}

.nav-cart {
    background: rgba(196,160,90,.12) !important;
    color: var(--gold-pale) !important;
    border: 1px solid rgba(196,160,90,.25) !important;
    border-radius: 3px !important;
}

.nav-cart:hover {
    background: rgba(196,160,90,.22) !important;
}

.nav-admin {
    background: rgba(253,250,244,.06) !important;
    border: 1px solid rgba(253,250,244,.12) !important;
    border-radius: 3px !important;
}

/* ===========================
   MAIN
   =========================== */

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem var(--gutter);
    min-height: calc(100vh - 260px);
}

/* ===========================
   MESSAGES
   =========================== */

.messages {
    margin: 0 0 2rem;
}

.message {
    padding: 1rem 1.5rem;
    margin-bottom: .75rem;
    border-radius: 2px;
    font-size: .9rem;
    font-weight: 400;
    letter-spacing: .02em;
    border-left: 3px solid;
    animation: fadeDown .35s var(--ease);
}

.message.success {
    background: #eef6f1;
    color: var(--success);
    border-color: var(--success);
}

.message.error {
    background: #f8eded;
    color: var(--error);
    border-color: var(--error);
}

.message.warning {
    background: #f8f2e6;
    color: var(--warning);
    border-color: var(--warning);
}

/* ===========================
   HERO
   =========================== */

.hero {
    position: relative;
    text-align: center;
    padding: 6rem 2rem 5rem;
    margin-bottom: 5rem;
    background: var(--cream);
    overflow: hidden;
    border: 1px solid var(--stone);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(154,117,53,.07) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 20% 100%, rgba(154,117,53,.05) 0%, transparent 60%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 5rem);
    font-weight: 300;
    font-style: italic;
    color: var(--obsidian);
    margin-bottom: 1.25rem;
    animation: fadeUp .9s var(--ease) .1s both;
}

.hero p {
    font-size: 1.05rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--smoke);
    font-weight: 400;
    animation: fadeUp .9s var(--ease) .25s both;
}

/* ===========================
   SECTION HEADING
   =========================== */

.section-heading {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 1px;
    background: var(--gold);
}

/* ===========================
   PRODUCT GRID
   =========================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: var(--cream);
    border: 1px solid var(--stone);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeUp .6s var(--ease) both;
}

.product-card:nth-child(1) { animation-delay: .05s; }
.product-card:nth-child(2) { animation-delay: .10s; }
.product-card:nth-child(3) { animation-delay: .15s; }
.product-card:nth-child(4) { animation-delay: .20s; }
.product-card:nth-child(n+5) { animation-delay: .25s; }

.product-card:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--mist);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s var(--ease);
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--mist), var(--stone));
}

.product-card-placeholder svg {
    width: 56px;
    height: 56px;
    opacity: .25;
    stroke: var(--gold);
    fill: none;
    stroke-width: 1;
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--obsidian);
    color: var(--gold-pale);
    padding: .3rem .9rem;
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .15em;
    text-transform: uppercase;
    z-index: 2;
}

.product-info {
    padding: 1.5rem;
    border-top: 1px solid var(--stone);
}

.product-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--obsidian);
    margin-bottom: .35rem;
    line-height: 1.3;
}

.product-brand {
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--smoke);
    margin-bottom: .75rem;
}

.product-price {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: .02em;
    margin: .5rem 0 1rem;
}

.product-info .btn {
    width: 100%;
    text-align: center;
}

/* ===========================
   BOTONES
   =========================== */

.btn {
    display: inline-block;
    padding: .8rem 2rem;
    background: var(--obsidian);
    color: var(--ivory);
    font-family: var(--font-body);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--espresso);
    border-color: var(--gold-light);
    color: var(--gold-pale);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--obsidian);
    border-color: var(--stone);
}

.btn-secondary:hover {
    background: var(--mist);
    border-color: var(--gold-light);
    color: var(--obsidian);
}

.btn-accent {
    background: var(--gold);
    color: var(--ivory);
    border-color: var(--gold);
}

.btn-accent:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    color: var(--obsidian);
}

.btn-danger {
    background: var(--error);
    color: var(--ivory);
    border-color: var(--error);
}

.btn-danger:hover {
    background: #7a2828;
    border-color: #7a2828;
    color: var(--ivory);
}

.btn-large {
    font-size: .9rem;
    padding: 1.1rem 3rem;
}

.btn:disabled {
    background: var(--stone);
    color: var(--smoke);
    cursor: not-allowed;
    border-color: transparent;
    transform: none;
}

/* ===========================
   SEARCH
   =========================== */

.search-container {
    margin: 0 auto 2.5rem;
    max-width: 520px;
}

.search-wrapper {
    display: flex;
    border: 1px solid var(--stone);
    background: var(--cream);
    overflow: hidden;
    transition: var(--transition);
}

.search-wrapper:focus-within {
    border-color: var(--gold-light);
    box-shadow: 0 0 0 3px rgba(154,117,53,.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: .875rem 1.25rem;
    font-size: .9rem;
    background: transparent;
    font-family: var(--font-body);
    outline: none;
    color: var(--obsidian);
}

.search-input::placeholder {
    color: var(--smoke);
    letter-spacing: .04em;
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--obsidian);
    border: none;
    padding: .875rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gold-light);
}

.search-button:hover {
    background: var(--espresso);
}

.search-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* ===========================
   FILTROS
   =========================== */

.filters-container {
    margin: 0 0 2.5rem;
    padding: 1.75rem 2rem;
    background: var(--cream);
    border: 1px solid var(--stone);
}

.filters-container h3 {
    font-size: .75rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--smoke);
    margin-bottom: 1.25rem;
    font-family: var(--font-body);
    font-weight: 500;
}

.filters-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* ===========================
   FORMULARIOS
   =========================== */

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: .5rem;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink);
}

input,
textarea,
select {
    width: 100%;
    padding: .8rem 1rem;
    border: 1px solid var(--stone);
    border-radius: 2px;
    font-size: .95rem;
    font-family: var(--font-body);
    font-weight: 300;
    transition: var(--transition);
    background: var(--cream);
    color: var(--obsidian);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold-light);
    background: var(--cream);
    box-shadow: 0 0 0 3px rgba(154,117,53,.08);
}

/* ===========================
   DETALLE DE PRODUCTO
   =========================== */

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    margin: 2rem 0;
    align-items: start;
}

.product-detail-image {
    background: var(--mist);
    border: 1px solid var(--stone);
    overflow: hidden;
    position: sticky;
    top: 90px;
    animation: fadeLeft .7s var(--ease);
}

.product-detail-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform .8s var(--ease);
}

.product-detail-image:hover img {
    transform: scale(1.03);
}

.product-detail-image-placeholder {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-image-placeholder svg {
    width: 80px;
    height: 80px;
    stroke: var(--stone);
    fill: none;
    stroke-width: 1;
}

.product-detail-info {
    animation: fadeRight .7s var(--ease);
}

.product-detail-eyebrow {
    font-size: .75rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 500;
    margin-bottom: 1rem;
}

.product-detail-info h1 {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-style: italic;
    margin-bottom: .5rem;
}

.product-detail-brand {
    font-size: .85rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--smoke);
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--stone);
}

.product-detail-price {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--gold);
    margin: 1.5rem 0;
    letter-spacing: .02em;
}

.product-specs {
    margin: 2rem 0;
    border: 1px solid var(--stone);
}

.product-specs-title {
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--smoke);
    font-weight: 500;
    padding: .875rem 1.25rem;
    background: var(--mist);
    border-bottom: 1px solid var(--stone);
    font-family: var(--font-body);
}

.product-spec-row {
    display: flex;
    justify-content: space-between;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid var(--stone);
    font-size: .9rem;
}

.product-spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--smoke);
    font-weight: 300;
}

.spec-value {
    color: var(--obsidian);
    font-weight: 500;
}

.product-description {
    margin: 2rem 0;
    line-height: 1.85;
    color: var(--smoke);
    font-size: .95rem;
}

.product-stock {
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 1rem 0;
}

.product-stock.in-stock  { color: var(--success); }
.product-stock.out-of-stock { color: var(--error); }

/* ===========================
   CARRITO
   =========================== */

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    background: var(--cream);
    border: 1px solid var(--stone);
    padding: 1.5rem;
    margin-bottom: 1px;
    transition: var(--transition);
    animation: fadeUp .5s var(--ease) both;
}

.cart-item:hover {
    border-color: var(--gold-light);
}

.cart-item-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    background: var(--mist);
    border: 1px solid var(--stone);
}

.cart-item-info h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--obsidian);
    margin-bottom: .3rem;
}

.cart-item-info p {
    font-size: .8rem;
    letter-spacing: .06em;
    color: var(--smoke);
}

.cart-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.cart-quantity {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    min-width: 32px;
    text-align: center;
    color: var(--obsidian);
}

.cart-subtotal {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--gold);
    min-width: 120px;
    text-align: right;
}

.cart-total {
    background: var(--cream);
    border: 1px solid var(--stone);
    padding: 2rem;
    margin-top: 2rem;
    text-align: right;
}

.cart-total-label {
    font-size: .75rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--smoke);
    font-weight: 500;
    margin-bottom: .5rem;
}

.cart-total-amount {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

/* ===========================
   RESEÑAS
   =========================== */

.reviews-section {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--stone);
}

.review-form {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--cream);
    border: 1px solid var(--stone);
}

.review-card {
    padding: 1.5rem;
    margin-bottom: 1px;
    background: var(--cream);
    border: 1px solid var(--stone);
    transition: var(--transition);
    animation: fadeUp .5s var(--ease) both;
}

.review-card:hover {
    border-color: var(--gold-light);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.review-author {
    font-weight: 500;
    color: var(--obsidian);
    font-size: .9rem;
}

.review-rating {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: .1em;
}

.review-comment {
    margin: .75rem 0;
    line-height: 1.7;
    color: var(--smoke);
    font-size: .95rem;
}

.review-date {
    color: var(--smoke);
    font-size: .78rem;
    letter-spacing: .04em;
}

/* ===========================
   PRODUCT META TAGS
   =========================== */

.product-category {
    display: inline-block;
    background: var(--mist);
    color: var(--gold);
    padding: .25rem .75rem;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 1px solid var(--gold-pale);
    margin-bottom: .75rem;
}

/* ===========================
   FOOTER
   =========================== */

footer {
    background: var(--obsidian);
    color: rgba(253,250,244,.55);
    text-align: center;
    padding: 3.5rem var(--gutter);
    margin-top: 6rem;
    border-top: 1px solid rgba(196,160,90,.15);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: .75rem;
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: rgba(196,160,90,.35);
    margin: 1rem auto;
}

footer p {
    font-size: .82rem;
    color: rgba(253,250,244,.45);
    letter-spacing: .05em;
}

/* ===========================
   SCROLLBAR
   =========================== */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb { background: var(--stone); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-light); }

/* ===========================
   ANIMACIONES
   =========================== */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.fade-in {
    animation: fadeUp .6s var(--ease);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .product-detail-image {
        position: static;
        max-width: 540px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    :root { --gutter: 1.25rem; }

    nav { padding: 0 1.25rem; height: 58px; }

    .nav-brand { font-size: 1.2rem; }

    nav ul li a { font-size: .75rem; padding: .45rem .7rem; }

    .hero { padding: 3.5rem 1.5rem 3rem; }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-actions {
        flex-wrap: wrap;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    nav ul { gap: .1rem; }
    nav ul li a { font-size: .7rem; padding: .4rem .55rem; letter-spacing: .03em; }
}
