/* ==========================================================================
   DINASTÍA-SHOP - ESTILOS COMPLETOS (SOLO CATÁLOGO, BANNER Y COMPRA)
   ========================================================================== */

:root {
    --bg-pure: #ffffff;
    --bg-light: #f8f9fa;
    --text-main: #121212;
    --text-muted: #747d8c;
    --accent-blue: #00d4ff;
    --accent-blue-transparent: rgba(0, 212, 255, 0.05);
    --discount-red: #ff4757;
    --font-display: 'Syne', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.08);
    --border-color: rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-pure);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 50px; /* Sin barra inferior */
}

/* --- ENCABEZADO --- */
header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--text-main);
    text-decoration: none;
}

.logo span { color: var(--accent-blue); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--text-main);
    color: var(--bg-pure);
    font-size: 0.65rem;
    font-weight: 700;
    width: 17px;
    height: 17px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- CONTROLES Y BUSCADOR --- */
.global-controls {
    padding: 25px 5% 10px;
    max-width: 1400px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    max-width: 100%;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-blue);
    background: var(--bg-pure);
    box-shadow: var(--shadow);
}

.search-wrapper .material-icons {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.filter-tags::-webkit-scrollbar { display: none; }

.filter-btn {
    background: var(--bg-light);
    border: 1px solid rgba(0,0,0,0.03);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--text-main);
    color: var(--bg-pure);
    border-color: var(--text-main);
}

/* --- BANNER --- */
.ads-banner-section {
    padding: 10px 5% 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.ads-slider-wrapper {
    width: 100%;
    height: 380px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    background: #f0f0f0;
    cursor: pointer;
}

.ads-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.ad-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: none;
    animation: fadeAd 1s ease forwards;
}

.ad-slide.active { display: block; }

@keyframes fadeAd {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- CUADRÍCULA TIENDA --- */
.catalog-container {
    padding: 10px 5% 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--bg-pure);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.03);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: rgba(0, 212, 255, 0.2);
}

.product-image-wrapper { 
    width: 100%; 
    height: 320px; 
    background: var(--bg-light); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    overflow: hidden;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image-wrapper img { transform: scale(1.04); }

.promo-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--discount-red);
    color: var(--bg-pure);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.product-info { padding: 25px; }
.product-category { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.product-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; color: var(--text-main); }
.price-box { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.price-original { font-size: 0.9rem; color: var(--text-muted); text-decoration: line-through; }
.price-current { font-size: 1.25rem; font-weight: 800; color: var(--text-main); }
.price-current span { color: var(--accent-blue); }

.add-to-cart-btn {
    width: 100%;
    background: var(--text-main);
    color: var(--bg-pure);
    border: none;
    padding: 14px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    background: var(--accent-blue);
    color: var(--text-main);
}

/* --- DETALLE PRODUCTO --- */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 25px;
    color: var(--text-main);
    transition: var(--transition);
}

.back-btn:hover { color: var(--accent-blue); transform: translateX(-4px); }
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.media-gallery { width: 100%; position: relative; }
.slider-viewport { width: 100%; height: 480px; background: var(--bg-light); border-radius: 24px; overflow: hidden; position: relative; border: 1px solid rgba(0,0,0,0.03); }
.slide-item { width: 100%; height: 100%; display: none; align-items: center; justify-content: center; }
.slide-item.active { display: flex; }
.slide-item img, .slide-item video { width: 100%; height: 100%; object-fit: cover; }
.slider-nav { position: absolute; top: 50%; width: 100%; display: flex; justify-content: space-between; padding: 0 15px; transform: translateY(-50%); pointer-events: none; }
.slider-arrow { width: 45px; height: 45px; background: var(--bg-pure); border: 1px solid rgba(0,0,0,0.05); border-radius: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: auto; box-shadow: var(--shadow); transition: var(--transition); }
.slider-arrow:hover { background: var(--text-main); color: var(--bg-pure); }
.detail-info h2 { font-family: var(--font-display); font-size: 2rem; text-transform: uppercase; margin-bottom: 10px; }
.detail-category { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--accent-blue); letter-spacing: 1px; margin-bottom: 15px; }
.detail-description { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; line-height: 1.6; }
.size-section { margin-bottom: 30px; }
.size-section h4 { font-size: 0.85rem; text-transform: uppercase; margin-bottom: 12px; font-weight: 700; }
.size-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.size-box { border: 2px solid rgba(0,0,0,0.08); padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: var(--transition); }
.size-box.selected { border-color: var(--accent-blue); background: var(--bg-pure); color: var(--text-main); }
.size-box.sold-out { background-color: #f1f2f6; color: #a4b0be; cursor: not-allowed; position: relative; }
.size-box.sold-out::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top right, transparent calc(50% - 1px), #a4b0be calc(50% - 1px), #a4b0be calc(50% + 1px), transparent calc(50% + 1px)); }

/* --- CHECKOUT --- */
.checkout-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    max-width: 1400px;
    margin: 10px auto 40px;
    padding: 0 5%;
}

.checkout-box {
    background: var(--bg-pure);
    border-radius: 24px;
    padding: 35px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow);
}

.checkout-box h2 {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1.6rem;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 15px;
}

.payment-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.pay-option-card {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pay-option-card.selected {
    border-color: var(--accent-blue);
    background-color: rgba(0, 212, 255, 0.02);
}

.pay-option-card h3 { font-size: 1.05rem; font-weight: 700; }
.pay-option-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.billing-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full-width { grid-column: span 2; }
.form-group label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-main); }

.form-group input, .form-group select {
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    background: var(--bg-light);
    width: 100%;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--accent-blue);
    background: var(--bg-pure);
}

.delivery-stations-container {
    display: none;
    animation: fadeIn 0.3s ease;
    background: var(--bg-light);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.delivery-stations-container h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 15px; text-transform: uppercase; }
.station-line-block { margin-bottom: 12px; font-size: 0.9rem; line-height: 1.5; }
.station-line-block strong { color: var(--text-main); background: var(--accent-blue-transparent); padding: 2px 6px; border-radius: 6px; font-size: 0.8rem; margin-right: 5px; }

.order-summary-card {
    background: var(--bg-light);
    border-radius: 24px;
    padding: 35px;
    border: 1px solid rgba(0,0,0,0.02);
    height: fit-content;
    box-shadow: var(--shadow);
}

.order-summary-card h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; text-transform: uppercase; font-family: var(--font-body); }
.summary-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.95rem; }
.summary-row.total-row { border-bottom: none; font-size: 1.3rem; font-weight: 800; margin-top: 15px; color: var(--text-main); }
.summary-items-list { max-height: 180px; overflow-y: auto; margin-bottom: 10px; padding-right: 5px; }
.summary-item-line { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; font-weight: 600; }

/* --- CONFIRMACIÓN --- */
.thank-you-container { max-width: 900px; margin: 40px auto; padding: 0 5%; }
.thank-you-header { margin-bottom: 40px; }
.thank-you-header h1 { font-family: var(--font-body); font-weight: 800; font-size: 1.8rem; margin-bottom: 8px; }
.thank-you-header p { color: var(--text-muted); }
.receipt-grid-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; background: var(--bg-light); padding: 20px 30px; border-radius: 16px; margin-bottom: 40px; }
.meta-block h5 { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
.meta-block p { font-weight: 700; font-size: 0.95rem; }
.bank-details-box { border: 1px solid var(--border-color); border-radius: 20px; padding: 30px; margin-bottom: 40px; }
.bank-details-box h3 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; }
.bank-info-row { margin-bottom: 12px; font-size: 0.9rem; }
.bank-info-row strong { font-weight: 700; text-transform: uppercase; font-size: 0.8rem; color: var(--text-muted); display: inline-block; width: 120px; }

.checkout-btn { 
    width: 100%; background: var(--text-main); color: var(--bg-pure); border: none; padding: 16px; border-radius: 50px; font-family: var(--font-body); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.checkout-btn:hover { background: var(--accent-blue); color: var(--text-main); }

/* --- SIDEBAR CARRITO --- */
.cart-sidebar { position: fixed; top: 0; right: -100%; width: 400px; height: 100vh; background: var(--bg-pure); z-index: 1000; box-shadow: -15px 0 40px rgba(0,0,0,0.06); transition: var(--transition); display: flex; flex-direction: column; }
.cart-sidebar.open { right: 0; }
.cart-header { padding: 30px; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; }
.cart-header h2 { font-family: var(--font-display); font-size: 1.3rem; text-transform: uppercase; }
.close-cart-btn { background: none; border: none; cursor: pointer; color: var(--text-main); display: flex; align-items: center; }
.cart-items-list { flex: 1; overflow-y: auto; padding: 30px; display: flex; flex-direction: column; gap: 20px; }
.cart-item { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,0.04); padding-bottom: 15px; }
.cart-item-details { display: flex; flex-direction: column; gap: 4px; max-width: 80%; }
.cart-item-details h4 { font-size: 0.9rem; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.cart-item-details p { font-size: 0.85rem; color: var(--accent-blue); font-weight: 700; }
.remove-item-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; }
.remove-item-btn:hover { color: var(--discount-red); }
.cart-footer { padding: 30px; border-top: 1px solid rgba(0,0,0,0.05); background: var(--bg-light); }
.cart-total-box { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; }

/* --- VISTAS SPA --- */
.view-section {
    display: none; 
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .ads-slider-wrapper { height: 300px; }
    .checkout-layout { grid-template-columns: 1fr; gap: 30px; padding: 0 4%; }
    .checkout-box { padding: 24px; border-radius: 20px; }
    .billing-form { grid-template-columns: 1fr; gap: 16px; }
    .form-group.full-width { grid-column: span 1; }
    .payment-selector { grid-template-columns: 1fr; gap: 12px; }
    .order-summary-card { padding: 24px; border-radius: 20px; }
    .detail-layout { grid-template-columns: 1fr; gap: 30px; }
    .slider-viewport { height: 380px; }
    .receipt-grid-meta { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 576px) {
    .ads-slider-wrapper { height: auto; aspect-ratio: 14 / 4; border-radius: 20px; }
    .ad-slide { background-size: 100% 100%; }
    .cart-sidebar { width: 100%; }
    .checkout-layout { padding: 0 3%; }
    .products-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .product-card { border-radius: 16px; }
    .product-image-wrapper { height: 180px; }
    .product-info { padding: 15px; }
    .product-category { font-size: 0.65rem; }
    .product-title { font-size: 0.9rem; -webkit-line-clamp: 2; -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden; height: 38px;}
    .price-original { font-size: 0.8rem; }
    .price-current { font-size: 1rem; }
    .add-to-cart-btn { font-size: 0.75rem; padding: 12px; }
}