/* ================================
   VARIABLES Y RESET
   ================================ */

:root {
    --primary-bg: #fafaf9;
    --secondary-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #2d2d2d;
    --accent-hover: #1a1a1a;
    --border: #e5e5e5;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Work Sans', sans-serif;
    --nav-height: 70px;
    --container-width: 1400px;
    --section-padding: 80px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
button { border: none; background: none; cursor: pointer; font-family: inherit; transition: var(--transition); }
input, select, textarea { font-family: inherit; border: none; outline: none; }

/* ================================
   NAVBAR
   ================================ */

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(250, 250, 249, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled { box-shadow: 0 2px 20px var(--shadow); }

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

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

.logo { font-family: var(--font-heading); font-size: 28px; font-weight: 600; letter-spacing: 2px; }

.nav-links { display: flex; gap: 40px; align-items: center; }

.nav-links a {
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 1px;
    background: var(--text-primary);
    transition: var(--transition);
}

.nav-links a:hover::after { width: 100%; }

.cart-link { position: relative; }

.cart-badge {
    position: absolute;
    top: -8px; right: -12px;
    background: var(--accent);
    color: white;
    width: 18px; height: 18px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-actions { display: flex; gap: 20px; align-items: center; }

.search-toggle, .cart-icon { padding: 8px; position: relative; }

.cart-badge-icon {
    position: absolute;
    top: 0; right: 0;
    background: var(--accent);
    color: white;
    width: 16px; height: 16px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-overlay {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active { display: block; opacity: 1; }

/* Search Bar */
.search-bar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid transparent;
}

.search-bar.active { max-height: 80px; border-top: 1px solid var(--border); }

.search-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 15px 40px;
    display: flex;
    gap: 10px;
}

#searchInput {
    flex: 1;
    padding: 12px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

#searchButton {
    padding: 12px 30px;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#searchButton:hover { background: var(--accent-hover); }

/* ================================
   LAYOUT
   ================================ */

main {
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

.page { display: none; animation: fadeIn 0.5s ease; }
.page.active { display: block; }

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

.page-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 400;
    text-align: center;
    margin: 60px 0 40px;
}

/* ================================
   HOME PAGE
   ================================ */

.hero {
    height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content { text-align: center; z-index: 2; animation: heroFadeIn 1s ease; }

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

.hero-title { font-family: var(--font-heading); font-size: 80px; font-weight: 300; letter-spacing: 2px; margin-bottom: 10px; }
.hero-subtitle { font-size: 20px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 40px; }

.gradient-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.3; animation: float 8s ease-in-out infinite; }
.orb-1 { width: 500px; height: 500px; background: linear-gradient(135deg, #d4a574, #c4956c); top: -200px; right: -200px; }
.orb-2 { width: 400px; height: 400px; background: linear-gradient(135deg, #e5d3c8, #d4c4b8); bottom: -150px; left: -150px; animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50%       { transform: translate(30px, 30px); }
}

.featured-categories { padding: var(--section-padding) 40px; max-width: var(--container-width); margin: 0 auto; }

.section-title { font-family: var(--font-heading); font-size: 42px; font-weight: 400; text-align: center; margin-bottom: 60px; }

.categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }

.category-card { cursor: pointer; transition: var(--transition); }
.category-image { aspect-ratio: 3/4; overflow: hidden; margin-bottom: 15px; border-radius: 4px; }
.category-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.category-card:hover .category-image img { transform: scale(1.05); }
.category-card h3 { font-family: var(--font-heading); font-size: 24px; font-weight: 400; text-align: center; }

/* ================================
   PRODUCTS PAGE
   ================================ */

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 40px 20px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.filter-toggle { display: none; align-items: center; gap: 8px; padding: 10px 20px; background: white; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }

.products-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 20px 40px 80px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Filters */
.filters-sidebar {
    background: white;
    padding: 30px;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: calc(var(--nav-height) + 20px);
}

.filters-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.filters-header h3 { font-family: var(--font-heading); font-size: 24px; font-weight: 400; }
.filters-close { display: none; font-size: 28px; color: var(--text-secondary); }

.filter-group { margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--border); }
.filter-group:last-of-type { border-bottom: none; }
.filter-group h4 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }

.filter-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.filter-group label:hover { background: var(--primary-bg); }

.price-inputs { display: flex; align-items: center; gap: 10px; width: 100%; }
.price-inputs input { flex: 1; width: 0; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
.price-inputs span { flex-shrink: 0; color: var(--text-secondary); }

.size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.size-grid label { padding: 10px; border: 1px solid var(--border); border-radius: 4px; text-align: center; justify-content: center; }
.size-grid label:has(input:checked) { background: var(--accent); color: white; border-color: var(--accent); }

/* Products content */
.products-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 15px 0; }
.products-toolbar span { font-size: 14px; color: var(--text-secondary); }
.products-toolbar select { padding: 10px 15px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; background: white; cursor: pointer; }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 30px; }

.product-card { cursor: pointer; transition: var(--transition); }
.product-card-image { aspect-ratio: 3/4; overflow: hidden; margin-bottom: 15px; background: #f5f5f5; border-radius: 4px; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-info { padding: 0 5px; }
.product-card-category { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 5px; }
.product-card-name { font-size: 16px; font-weight: 500; margin-bottom: 8px; }
.product-card-price { font-size: 18px; font-weight: 600; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 60px; }
.pagination button { padding: 10px 15px; background: white; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; min-width: 40px; }
.pagination button:hover { background: var(--primary-bg); }
.pagination button.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ================================
   MODAL PRODUCTO
   ================================ */

#productModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.7);
}

#productModal.active { display: flex; align-items: center; justify-content: center; }

#productModal .modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: pointer; }

#productModal .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 1100px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100000;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.95);
    border: 2px solid #e0e0e0;
    font-size: 28px;
    cursor: pointer;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    color: #666;
    font-weight: 300;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-close:hover { background: #f44336; border-color: #f44336; color: white; transform: rotate(90deg) scale(1.1); }

#productModal .product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: 50px; }
#productModal .product-detail-images img { width: 100%; height: auto; max-height: 600px; object-fit: cover; border-radius: 8px; }
#productModal .product-detail-info { display: flex; flex-direction: column; gap: 20px; }
#productModal .product-detail-category { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: #888; font-weight: 500; }
#productModal .product-detail-name { font-size: 36px; font-weight: 300; margin: 0; line-height: 1.2; }
#productModal .product-detail-price { font-size: 28px; font-weight: 600; color: #1a1a1a; }
#productModal .product-detail-description { font-size: 15px; line-height: 1.7; color: #666; }

#productModal .size-selector h4,
#productModal .color-selector h4,
#productModal .quantity-selector h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-bottom: 12px; }

#productModal .size-options,
#productModal .color-options { display: flex; gap: 10px; flex-wrap: wrap; }

#productModal .size-option,
#productModal .color-option {
    min-width: 50px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

#productModal .size-option:hover,
#productModal .color-option:hover { border-color: #1a1a1a; }
#productModal .size-option.selected,
#productModal .color-option.selected { border-color: #1a1a1a; background: #1a1a1a; color: white; }

#productModal .quantity-controls { display: flex; align-items: center; gap: 15px; }

#productModal .quantity-btn {
    width: 44px; height: 44px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#productModal .quantity-btn:hover { border-color: #1a1a1a; }
#productModal .quantity-input { width: 70px; height: 44px; text-align: center; border: 2px solid #ddd; border-radius: 4px; font-size: 16px; font-weight: 600; }

#productModal .btn-primary {
    width: 100%;
    padding: 16px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

#productModal .btn-primary:hover { background: #333; transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.2); }

/* ================================
   MODAL ADMIN PRODUCTOS
   ================================ */

.admin-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.admin-modal.active { display: flex; align-items: center; justify-content: center; padding: 20px; }

.admin-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0,0,0,0.4);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-modal-header {
    padding: 28px 28px 20px;
    border-bottom: 2px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.admin-modal-header h2 { margin: 0; font-size: 26px; font-weight: 700; color: #1a1a1a; }

.admin-modal-close {
    background: white;
    border: 2px solid #e0e0e0;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.25s ease;
    font-weight: 300;
}

.admin-modal-close:hover { background: #f44336; border-color: #f44336; color: white; transform: rotate(90deg) scale(1.1); }

.admin-modal-body-wrapper { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.admin-modal-body { padding: 28px; overflow-y: auto; flex: 1; }
.admin-modal-body .form-group { margin-bottom: 22px; }
.admin-modal-body .form-group:last-of-type { margin-bottom: 0; }
.admin-modal-body .form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #2d2d2d; font-size: 14px; }

.admin-modal-body .form-group input,
.admin-modal-body .form-group textarea,
.admin-modal-body .form-group select {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.25s ease;
    box-sizing: border-box;
    background: white;
}

.admin-modal-body .form-group input:focus,
.admin-modal-body .form-group textarea:focus,
.admin-modal-body .form-group select:focus {
    outline: none;
    border-color: #2d2d2d;
    box-shadow: 0 0 0 4px rgba(45,45,45,0.08);
}

.admin-modal-body .form-group textarea { resize: vertical; min-height: 90px; }

.admin-modal-footer {
    padding: 20px 28px 28px;
    border-top: 2px solid #e8e8e8;
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    background: #fafafa;
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
}

.admin-modal-footer .btn-primary,
.admin-modal-footer .btn-secondary { padding: 14px 28px; border-radius: 10px; font-weight: 600; cursor: pointer; border: none; font-size: 15px; }
.admin-modal-footer .btn-primary { background: linear-gradient(135deg, #2d2d2d, #1a1a1a); color: white; box-shadow: 0 4px 12px rgba(45,45,45,0.25); }
.admin-modal-footer .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(45,45,45,0.35); }
.admin-modal-footer .btn-secondary { background: white; color: #666; border: 2px solid #e0e0e0; }
.admin-modal-footer .btn-secondary:hover { background: #f5f5f5; }

.admin-modal-body::-webkit-scrollbar { width: 10px; }
.admin-modal-body::-webkit-scrollbar-track { background: #f5f5f5; }
.admin-modal-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 5px; border: 2px solid #f5f5f5; }
.admin-modal-body::-webkit-scrollbar-thumb:hover { background: #999; }

/* Confirm modal */
.confirm-modal { display: none; position: fixed; z-index: 10000; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(5px); }
.confirm-modal.active { display: flex; align-items: center; justify-content: center; animation: fadeIn 0.3s ease; padding: 20px; }

.confirm-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 32px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.4);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-modal-content h3 { margin: 0 0 14px; font-size: 22px; font-weight: 700; }
.confirm-modal-content p { margin: 0 0 28px; color: #666; line-height: 1.7; }

.confirm-modal-actions { display: flex; gap: 14px; justify-content: flex-end; }
.confirm-modal-actions button { padding: 13px 26px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; font-size: 15px; }
.confirm-modal-actions .btn-danger { background: linear-gradient(135deg, #f44336, #d32f2f); color: white; }
.confirm-modal-actions .btn-danger:hover { transform: translateY(-2px); }
.confirm-modal-actions .btn-cancel { background: white; color: #666; border: 2px solid #e0e0e0; }
.confirm-modal-actions .btn-cancel:hover { background: #f5f5f5; }

/* ================================
   CART
   ================================ */

.cart-container { max-width: 1000px; margin: 0 auto; padding: 40px; }
.cart-items { margin-bottom: 40px; }
.cart-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; padding: 20px; background: white; border-radius: 8px; margin-bottom: 15px; }
.cart-item-image { aspect-ratio: 3/4; overflow: hidden; border-radius: 4px; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-details h3 { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.cart-item-details p { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.cart-item-price { font-size: 20px; font-weight: 600; }
.cart-item-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

.cart-summary { background: white; padding: 30px; border-radius: 8px; }
.cart-summary h3 { font-family: var(--font-heading); font-size: 24px; font-weight: 400; margin-bottom: 20px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-summary-row.total { font-size: 20px; font-weight: 600; border-bottom: none; padding-top: 20px; }

.empty-cart { text-align: center; padding: 80px 20px; }
.empty-cart h3 { font-family: var(--font-heading); font-size: 32px; font-weight: 400; margin-bottom: 20px; }

/* ================================
   ORDERS
   ================================ */

.orders-container { max-width: 1000px; margin: 0 auto; padding: 40px; }
.order-card { background: white; border-radius: 8px; padding: 30px; margin-bottom: 20px; }
.order-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.order-number { font-size: 14px; color: var(--text-secondary); margin-bottom: 5px; }
.order-date { font-size: 14px; color: var(--text-secondary); }

.order-status { padding: 8px 16px; border-radius: 20px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.order-status.pending    { background: #fef3c7; color: #92400e; }
.order-status.processing { background: #dbeafe; color: #1e40af; }
.order-status.shipped    { background: #e0e7ff; color: #4338ca; }
.order-status.delivered  { background: #d1fae5; color: #065f46; }
.order-status.cancelled  { background: #fee2e2; color: #991b1b; }

.order-items { margin-bottom: 20px; }
.order-item { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.order-item:last-child { border-bottom: none; }
.order-item-image { width: 80px; height: 100px; object-fit: cover; border-radius: 4px; }
.order-item-details h4 { font-size: 16px; font-weight: 500; margin-bottom: 5px; }
.order-item-details p { font-size: 14px; color: var(--text-secondary); }
.order-total { text-align: right; font-size: 20px; font-weight: 600; }

/* ================================
   AUTH
   ================================ */

.auth-container { min-height: calc(100vh - var(--nav-height) - 200px); display: flex; align-items: center; justify-content: center; padding: 60px 20px; }

.auth-box { background: white; padding: 60px; border-radius: 8px; width: 100%; max-width: 450px; box-shadow: 0 4px 20px var(--shadow); }

.auth-tabs { display: flex; gap: 20px; margin-bottom: 40px; }
.auth-tab { flex: 1; padding: 12px; font-size: 16px; font-weight: 500; border-bottom: 2px solid var(--border); transition: var(--transition); }
.auth-tab.active { border-bottom-color: var(--accent); }

.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group { margin-bottom: 25px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.form-group input { width: 100%; padding: 12px 15px; border: 1px solid var(--border); border-radius: 4px; font-size: 15px; }
.form-group input:focus { border-color: var(--accent); }

.auth-submit { width: 100%; padding: 15px; background: var(--accent); color: white; font-size: 15px; font-weight: 500; border-radius: 4px; margin-top: 10px; }
.auth-submit:hover { background: var(--accent-hover); }

.user-profile { text-align: center; }
.user-avatar { width: 100px; height: 100px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 600; margin: 0 auto 20px; }
.user-info h2 { font-family: var(--font-heading); font-size: 28px; font-weight: 400; margin-bottom: 10px; }
.user-info p { color: var(--text-secondary); margin-bottom: 30px; }

/* ================================
   ADMIN PAGE
   ================================ */

.admin-tabs {
    display: flex;
    gap: 10px;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
}

.admin-tab { padding: 15px 30px; font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; transition: var(--transition); }
.admin-tab:hover { background: var(--primary-bg); }
.admin-tab.active { border-bottom-color: var(--accent); }

.admin-tab-content { display: none; max-width: var(--container-width); margin: 0 auto; padding: 40px; }
.admin-tab-content.active { display: block; }

/* Admin header & actions */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.admin-header h2 { font-family: var(--font-heading); font-size: 32px; font-weight: 400; }

/* Admin Products */
.admin-products-grid { display: grid; gap: 20px; }

.admin-product-card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.admin-product-image { width: 100px; height: 120px; object-fit: cover; border-radius: 4px; }
.admin-product-info h3 { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.admin-product-info p { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.admin-product-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-edit, .btn-delete { padding: 8px 20px; font-size: 14px; border-radius: 4px; }
.btn-edit { background: white; border: 1px solid var(--accent); color: var(--accent); }
.btn-edit:hover { background: var(--primary-bg); }
.btn-delete { background: #dc2626; color: white; }
.btn-delete:hover { background: #b91c1c; }

/* Admin Orders */
.admin-orders-list { display: grid; gap: 20px; }
.admin-order-card { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 8px var(--shadow); }
.admin-order-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.status-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; background: white; cursor: pointer; }

/* Form helpers */
.product-form { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ================================
   BUTTONS
   ================================ */

.btn-primary {
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.btn-secondary {
    padding: 12px 24px;
    background: white;
    color: var(--accent);
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover { border-color: var(--accent); background: var(--primary-bg); }

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

.footer { background: var(--accent); color: white; padding: 60px 40px 20px; }
.footer-content { max-width: var(--container-width); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-section h3 { font-family: var(--font-heading); font-size: 24px; font-weight: 400; margin-bottom: 15px; }
.footer-section h4 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }
.footer-section a { display: block; margin-bottom: 10px; color: rgba(255,255,255,0.8); font-size: 14px; }
.footer-section a:hover { color: white; }
.footer-section p { color: rgba(255,255,255,0.8); font-size: 14px; margin-bottom: 8px; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.6); font-size: 13px; }

/* ================================
   UTILITIES
   ================================ */

.loading-spinner { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 3000; }
.loading-spinner.active { display: block; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.toast-container { position: fixed; top: calc(var(--nav-height) + 20px); right: 20px; z-index: 999999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; padding: 15px 20px; border-radius: 8px; box-shadow: 0 4px 12px var(--shadow-hover); min-width: 300px; animation: toastSlideIn 0.3s ease; }

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

.toast.success { border-left: 4px solid #10b981; }
.toast.error   { border-left: 4px solid #dc2626; }
.toast.info    { border-left: 4px solid #3b82f6; }

/* ================================
   MODAL TILOPAY
   ================================ */

.tilopay-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 1; transition: opacity 0.25s ease; }
.tilopay-backdrop { position: absolute; inset: 0; background: rgba(26,26,26,0.6); backdrop-filter: blur(6px); }

.tilopay-modal {
    position: relative;
    background: var(--secondary-bg);
    width: 100%;
    max-width: 460px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 2px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.25);
    animation: tilopaySlideUp 0.35s cubic-bezier(0.4,0,0.2,1);
    z-index: 1;
}

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

.tilopay-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 36px 36px 24px; border-bottom: 1px solid var(--border); }
.tilopay-header-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-secondary); margin-bottom: 6px; }
.tilopay-header-title { font-family: var(--font-heading); font-size: 28px; font-weight: 400; margin: 0; }

.tilopay-close { background: none; border: 1px solid var(--border); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); transition: var(--transition); flex-shrink: 0; margin-top: 4px; }
.tilopay-close:hover { background: var(--text-primary); border-color: var(--text-primary); color: white; }

.tilopay-summary { display: flex; justify-content: space-between; align-items: center; padding: 20px 36px; background: var(--primary-bg); }
.tilopay-summary-label { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.tilopay-summary-amount { font-family: var(--font-heading); font-size: 26px; font-weight: 500; }

.tilopay-divider { height: 1px; background: var(--border); }

.tilopay-form { padding: 28px 36px; display: flex; flex-direction: column; gap: 20px; }
.tilopay-field { display: flex; flex-direction: column; gap: 7px; }
.tilopay-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); }

.tilopay-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tilopay-input:focus { border-color: var(--text-primary); box-shadow: 0 0 0 3px rgba(26,26,26,0.07); }
.tilopay-input::placeholder { color: #bbb; }

.tilopay-input-wrap { position: relative; }
.tilopay-input-icon { position: absolute; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }
.tilopay-input-icon:not(.right) { left: 14px; }
.tilopay-input-icon.right { right: 14px; }
.tilopay-input.with-icon { padding-left: 44px; }

.tilopay-select-wrap { position: relative; }
.tilopay-select-wrap .tilopay-input { padding-right: 40px; cursor: pointer; }
.tilopay-select-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }

.tilopay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.tilopay-error { margin: 0 36px; padding: 12px 16px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 2px; color: #991b1b; font-size: 13px; }

.tilopay-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 72px);
    margin: 20px 36px 0;
    padding: 18px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.tilopay-pay-btn:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(26,26,26,0.2); }
.tilopay-pay-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.tilopay-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 8px; vertical-align: -3px; }

.tilopay-security { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 36px 28px; font-size: 11px; color: var(--text-secondary); }

.tilopay-modal::-webkit-scrollbar { width: 6px; }
.tilopay-modal::-webkit-scrollbar-track { background: transparent; }
.tilopay-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ================================
   DASHBOARD ADMIN
   ================================ */

.db-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 32px; }

.db-kpi { background: white; border: 1px solid var(--border); border-radius: 2px; padding: 24px 20px; display: flex; align-items: center; gap: 16px; transition: var(--transition); }
.db-kpi:hover { box-shadow: 0 4px 16px var(--shadow-hover); transform: translateY(-2px); }
.db-kpi.highlight { border-left: 3px solid #d97706; background: #fffbeb; }
.db-kpi-icon { font-size: 24px; flex-shrink: 0; }
.db-kpi-value { font-family: var(--font-heading); font-size: 22px; font-weight: 600; line-height: 1.2; }
.db-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); margin-top: 3px; }

.db-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 12px; margin-top: 8px; }

.db-status-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 32px; }
.db-status-card { background: white; border: 1px solid var(--border); border-radius: 2px; padding: 18px; text-align: center; border-top: 3px solid transparent; }
.db-status-card.pending    { border-top-color: #d97706; }
.db-status-card.processing { border-top-color: #2563eb; }
.db-status-card.shipped    { border-top-color: #7c3aed; }
.db-status-card.delivered  { border-top-color: #059669; }
.db-status-card.cancelled  { border-top-color: #dc2626; }
.db-status-count { font-family: var(--font-heading); font-size: 32px; font-weight: 600; line-height: 1; margin-bottom: 6px; }
.db-status-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); }

.db-card { background: white; border: 1px solid var(--border); border-radius: 2px; margin-bottom: 24px; overflow: hidden; }
.db-card-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.db-card-title { font-family: var(--font-heading); font-size: 20px; font-weight: 400; margin: 0; }
.db-card-sub { font-size: 12px; color: var(--text-secondary); }

.db-refresh-btn { font-size: 13px; color: var(--text-secondary); background: none; border: 1px solid var(--border); border-radius: 2px; padding: 6px 14px; cursor: pointer; transition: var(--transition); }
.db-refresh-btn:hover { background: var(--primary-bg); color: var(--text-primary); }

.db-chart { display: flex; align-items: flex-end; gap: 6px; padding: 24px 24px 16px; height: 180px; overflow-x: auto; }
.db-bar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 30px; }
.db-bar-fill { width: 100%; background: var(--border); border-radius: 2px 2px 0 0; transition: height 0.4s ease; min-height: 2px; }
.db-bar-fill.active { background: var(--accent); }
.db-bar-label { font-size: 9px; color: var(--text-secondary); text-align: center; white-space: nowrap; transform: rotate(-45deg); transform-origin: center; }

.db-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }

.db-top-list { padding: 8px 0; }
.db-top-row { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.db-top-row:last-child { border-bottom: none; }
.db-top-row:hover { background: var(--primary-bg); }
.db-top-rank { font-family: var(--font-heading); font-size: 20px; font-weight: 600; color: var(--border); width: 20px; flex-shrink: 0; text-align: center; }
.db-top-img { width: 44px; height: 52px; object-fit: cover; border-radius: 2px; background: var(--primary-bg); flex-shrink: 0; }
.db-top-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.db-top-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-top-cat { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.db-top-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.db-top-sold { font-size: 14px; font-weight: 600; }
.db-top-rev { font-size: 11px; color: var(--text-secondary); }

.db-recent-list { padding: 8px 0; }
.db-recent-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--border); gap: 12px; transition: background 0.15s; }
.db-recent-row:last-child { border-bottom: none; }
.db-recent-row:hover { background: var(--primary-bg); }
.db-recent-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.db-recent-id { font-size: 14px; font-weight: 500; }
.db-recent-user { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-recent-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.db-recent-total { font-size: 14px; font-weight: 600; }

.db-table { width: 100%; border-collapse: collapse; }
.db-th { padding: 12px 20px; text-align: left; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); background: var(--primary-bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.db-td { padding: 14px 20px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.db-table tr:last-child .db-td { border-bottom: none; }
.db-table tr:hover .db-td { background: var(--primary-bg); }
.db-td.mono  { font-family: monospace; font-size: 12px; color: var(--text-secondary); }
.db-td.bold  { font-weight: 600; }
.db-td.muted { color: var(--text-secondary); font-size: 12px; }

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

@media (max-width: 1400px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1200px) {
    .db-kpis       { grid-template-columns: repeat(3, 1fr); }
    .db-status-row  { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .nav-container { padding: 0 30px; }
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .admin-products-grid { grid-template-columns: repeat(2, 1fr); }
    .featured-categories { padding: 60px 30px; }

    .filters-sidebar {
        position: fixed;
        top: 0; left: -100%;
        width: 85%; max-width: 350px;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }

    .filters-sidebar.active { left: 0; }
    .filters-close { display: flex; }
    .filter-toggle { display: flex; }
    .products-container { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .db-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --nav-height: 60px; --section-padding: 50px; }

    .nav-container { padding: 0 20px; height: var(--nav-height); }
    .logo { font-size: 22px; order: 2; }
    .menu-toggle { display: flex; order: 1; }
    .nav-actions { order: 3; gap: 12px; }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 85%; max-width: 350px;
        height: calc(100vh - var(--nav-height));
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 20px;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        gap: 0;
    }

    .nav-links.active { left: 0; }
    .nav-links a { width: 100%; padding: 18px 10px; border-bottom: 1px solid var(--border); font-size: 15px; }
    .nav-links a::after { display: none; }

    .search-bar { position: fixed; top: var(--nav-height); left: 0; right: 0; background: white; box-shadow: 0 4px 20px rgba(0,0,0,0.1); z-index: 997; max-height: 0; }
    .search-bar.active { max-height: 100px; border-top: 1px solid var(--border); }
    .search-container { padding: 15px 20px; }

    .hero { height: 70vh; padding: 40px 20px; }
    .hero-title { font-size: 48px; }
    .hero-subtitle { font-size: 16px; letter-spacing: 2px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .products-header { flex-direction: column; gap: 15px; align-items: flex-start; padding: 30px 20px 15px; }
    .page-title { font-size: 36px; margin: 40px 0 20px; }
    .filter-toggle { width: 100%; justify-content: center; }
    .products-container { padding: 20px; gap: 20px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .products-toolbar { flex-wrap: wrap; gap: 15px; }

    #productModal .product-detail { grid-template-columns: 1fr; gap: 30px; padding: 30px 20px; }
    #productModal .product-detail-name { font-size: 28px; }
    #productModal .product-detail-price { font-size: 24px; }

    .cart-container { padding: 30px 20px; }
    .cart-item { grid-template-columns: 100px 1fr; gap: 15px; }
    .cart-item-actions { grid-column: 1/-1; flex-direction: row; align-items: center; justify-content: space-between; }
    .cart-summary { position: sticky; bottom: 0; margin: 0 -20px -30px; border-radius: 0; }

    .orders-container { padding: 30px 20px; }
    .order-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .order-item { flex-direction: column; }
    .order-item-image { width: 100%; height: 180px; }

    .auth-container { padding: 40px 20px; }
    .auth-box { padding: 40px 25px; }

    .admin-tabs { padding: 0 20px; overflow-x: auto; flex-wrap: nowrap; }
    .admin-tab { padding: 12px 20px; white-space: nowrap; font-size: 14px; }
    .admin-tab-content { padding: 30px 20px; }

    .admin-header { flex-direction: column; gap: 20px; align-items: flex-start; }
    .admin-header h2 { font-size: 28px; }
    .admin-header .btn-primary { width: 100%; }
    .admin-products-grid { grid-template-columns: 1fr; }
    .admin-product-card { grid-template-columns: 100px 1fr; gap: 15px; }
    .admin-product-actions { grid-column: 1/-1; flex-direction: row; gap: 10px; }
    .admin-product-actions button { flex: 1; }
    .admin-order-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .status-select { width: 100%; }

    .footer { padding: 40px 20px 20px; }
    .footer-content { grid-template-columns: 1fr; gap: 30px; }

    .toast-container { left: 20px; right: 20px; }
    .toast { min-width: auto; width: 100%; }

    .db-kpis       { grid-template-columns: repeat(2, 1fr); }
    .db-status-row  { grid-template-columns: repeat(2, 1fr); }
    .db-kpi-value   { font-size: 18px; }
    .db-chart       { height: 140px; }
    .db-card-header { flex-direction: column; gap: 8px; align-items: flex-start; }

    .tilopay-overlay { padding: 0; align-items: flex-end; }
    .tilopay-modal { max-width: 100%; max-height: 95vh; border-radius: 12px 12px 0 0; animation: tilopaySlideUpMobile 0.35s cubic-bezier(0.4,0,0.2,1); }
    @keyframes tilopaySlideUpMobile { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .tilopay-header, .tilopay-form, .tilopay-security, .tilopay-error { padding-left: 24px; padding-right: 24px; }
    .tilopay-summary { padding-left: 24px; padding-right: 24px; }
    .tilopay-pay-btn { width: calc(100% - 48px); margin-left: 24px; margin-right: 24px; }

    .admin-modal-content { max-height: 95vh; border-radius: 12px; }
    .admin-modal-header { padding: 20px; border-radius: 12px 12px 0 0; }
    .admin-modal-header h2 { font-size: 22px; }
    .admin-modal-body { padding: 20px; }
    .confirm-modal-content { padding: 24px; border-radius: 12px; }
    .admin-modal-footer { flex-direction: column-reverse; padding: 16px 20px 20px; }
    .admin-modal-footer .btn-primary, .admin-modal-footer .btn-secondary { width: 100%; }
}

@media (max-width: 480px) {
    .hero { height: 60vh; padding: 30px 15px; }
    .hero-title { font-size: 36px; }
    .hero-subtitle { font-size: 14px; }
    .categories-grid { grid-template-columns: 1fr; gap: 15px; }
    .section-title { font-size: 32px; }
    .page-title { font-size: 28px; }
    .products-grid { grid-template-columns: 1fr; }
    .filters-sidebar { width: 100%; }
    .size-grid { grid-template-columns: repeat(3, 1fr); }

    .cart-item { grid-template-columns: 80px 1fr; padding: 15px; }
    .order-card { padding: 20px 15px; }

    .db-kpis       { grid-template-columns: 1fr 1fr; }
    .db-status-row  { grid-template-columns: 1fr 1fr; }
    .db-top-row, .db-recent-row { padding: 12px 16px; }
    .db-td, .db-th  { padding: 10px 14px; }

    .admin-product-card { grid-template-columns: 1fr; }
    .admin-product-image { width: 100%; height: 200px; }

    .form-group input, .form-group textarea, .form-group select { font-size: 16px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
    .nav-container { padding: 0 15px; }
    .hero-title { font-size: 28px; }
    .products-container, .cart-container, .orders-container { padding: 15px; }
    .size-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (hover: none) and (pointer: coarse) {
    button, a, .size-option, .color-option, .quantity-btn,
    input[type="checkbox"], input[type="radio"] { min-height: 44px; }
    .nav-links a { padding: 20px 10px; }
    .admin-tab { padding: 15px 24px; }
}

@media print {
    .navbar, .filters-sidebar, .cart-summary, .admin-tabs,
    .footer, button, .modal { display: none !important; }
    .page { display: block !important; }
}







/* ── Tarjetas de prueba dentro del modal Tilopay ── */

.tp-test-cards {
    margin: 16px 36px 0;
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.tp-test-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary-bg);
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tp-test-toggle:hover {
    background: #f0f0ee;
    color: var(--text-primary);
}

.tp-test-body {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-test-note {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 2px;
}

.tp-test-note strong {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-primary);
}

/* Tarjeta individual */
.tp-card {
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.tp-card--approved { border-left: 3px solid #059669; }
.tp-card--declined { border-left: 3px solid #dc2626; }

.tp-card-badge {
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tp-badge--approved { background: #d1fae5; color: #065f46; }
.tp-badge--declined { background: #fee2e2; color: #991b1b; }

.tp-card-rows {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp-row-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp-row-val {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-mono {
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.tp-copy {
    background: none;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 3px 5px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: var(--transition);
    line-height: 1;
}

.tp-copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tp-fill-btn {
    width: 100%;
    padding: 8px;
    background: var(--primary-bg);
    border: none;
    border-top: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.tp-fill-btn:hover {
    background: var(--accent);
    color: white;
}

/* Responsive */
@media (max-width: 520px) {
    .tp-test-cards { margin-left: 24px; margin-right: 24px; }
}