:root {
    --primary: #000;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.4);
    --accent: #3498db;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    width: 95vw;
    height: 90vh;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Panel de Control */
.panel-control {
    width: 350px;
    background: var(--glass-bg);
    padding: 2.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    overflow-y: auto;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.main-logo {
    max-width: 150px;
    height: auto;
    display: block;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0;
    transform: scale(0.5);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.cart-badge.visible {
    opacity: 1;
    transform: scale(1);
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.2rem;
    letter-spacing: -0.5px;
}

header p {
    font-size: 0.9rem;
    color: #888;
}

.config-group {
    margin-bottom: 1.2rem;
}

.config-group h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #aaa;
    margin-bottom: 1.2rem;
    font-weight: 700;
}

/* Custom Select Styling */
.custom-select-wrapper select {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    background: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    outline: none;
    transition: 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.custom-select-wrapper select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.panel-footer-cart {
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.05);
}

.panel-footer-cart .btn-primary {
    width: 100%;
    max-width: none;
}

.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.2rem;
}

.header-with-action h2 {
    margin-bottom: 0 !important;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.8;
    transition: 0.2s;
    padding: 0;
}

.size-guide-wrapper {
    margin-top: 0.8rem;
    text-align: right;
}

.btn-text-action:hover {
    opacity: 1;
}

.button-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.btn-color {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

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

.btn-color.active {
    transform: scale(1.15);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
    z-index: 2;
}

.gender-selection {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-gender {
    flex: 1;
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-gender.active {
    background: var(--primary);
    color: white;
}

.size-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-size {
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
    font-size: 0.8rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-size.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(52, 152, 219, 0.05);
}

.size-selectors {
    display: flex;
    gap: 1rem;
}

.selector-box {
    flex: 1;
}

.selector-box label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
    color: #444;
}

.color-options {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.color-option {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: 0.2s;
}

.color-option.active {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Visualizador */
.visualizador {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.cards-wrapper {
    display: flex;
    gap: 2rem;
    width: 100%;
    justify-content: center;
}

.product-card {
    flex: 1;
    max-width: 450px;
    aspect-ratio: 1/1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.tshirt-base {
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

.base-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#card-trasera .base-img {
    display: block;
}

/* Ocultar el cuello frontal en la vista trasera (ya no es necesario con fotos completas) */
#card-trasera .tshirt-base::after {
    display: none;
}

/* Modal Tallas */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: auto;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
}

.size-chart {
    width: 100%;
    border-collapse: collapse;
}

.size-chart th {
    text-align: left;
    padding: 0.8rem;
    background: #f8f9fa;
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.size-chart td {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.size-chart tr:last-child td {
    border-bottom: none;
}

.tshirt-base.color-negro { background-color: #1a1a1a; }
.tshirt-base.color-blanco { background-color: #f8f9fa; }

.serigrafia {
    object-fit: contain;
    transition: all 0.4s ease;
    z-index: 5;
}

#card-frontal .serigrafia {
    position: relative;
    max-width: 20%;
    max-height: 20%;
    top: -20px;
}

#card-trasera .serigrafia {
    position: relative;
    max-width: 45%; 
    max-height: 45%;
}

.card-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    background: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Filtros de Serigrafía optimizados para blending */
.color-white { filter: brightness(2); }
.color-black { filter: brightness(0); }
.color-red   { filter: sepia(1) saturate(10) hue-rotate(0deg) brightness(0.8); }
.color-gold  { filter: sepia(1) saturate(5) hue-rotate(15deg) brightness(0.7); }

.inverted { filter: invert(1) !important; }

/* Responsive */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100vw;
        border-radius: 0;
    }

    .panel-control {
        width: 100%;
        order: 1; /* Ahora los controles salen primero */
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        padding: 1.5rem;
        height: auto;
        overflow-y: visible;
    }

    .visualizador {
        width: 100%;
        order: 2; /* Los modelos salen después de los controles */
        padding: 2rem 1rem;
        min-height: auto;
    }

    .cards-wrapper {
        flex-direction: column;
        gap: 3rem;
        align-items: center;
        width: 100%;
    }

    .product-card {
        width: 90%; /* Ancho aumentado al 90% del dispositivo */
        max-width: none;
        aspect-ratio: auto;
    }

    .tshirt-base {
        height: auto;
        aspect-ratio: 1/1.3;
    }

    header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .visualizador {
        min-height: 400px;
    }

    .btn-size {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .btn-color {
        width: 40px;
        height: 40px;
    }
}

/* Scrollbar personalizado */
.panel-control::-webkit-scrollbar {
    width: 6px;
}
.panel-control::-webkit-scrollbar-track {
    background: transparent;
}
.panel-control::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* Checkout View */
.hidden {
    display: none !important;
}

.checkout-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 1.5rem;
    min-height: min-content;
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.checkout-content {
    margin-top: 1rem;
}

.checkout-vertical-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-group-row {
        grid-template-columns: 1fr;
    }
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.payment-header {
    text-align: center;
    margin-bottom: 2rem;
}

.payment-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.payment-header p {
    color: #666;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.summary-box {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.summary-item span:first-child {
    font-weight: 600;
}

.payment-area {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.btn-primary {
    background: #1a1a1a;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-2px);
}

.panel-footer {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    justify-content: center;
}

.panel-footer .btn-primary {
    max-width: 200px;
}

.btn-text {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: underline;
}

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

/* Checkout Pages Style */
.checkout-page {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 2rem 1rem;
    font-family: 'Outfit', sans-serif;
}

.checkout-page-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    padding: 2rem;
}

.checkout-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.checkout-page-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.cart-container {
    margin-bottom: 2rem;
    background: #fdfdfd;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #eee;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border-left: 4px solid var(--accent);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    display: block;
}

.cart-item-details {
    font-size: 0.85rem;
    color: #777;
}

.btn-remove {
    background: #fff5f5;
    color: #e74c3c;
    border: 1px solid #ffc9c9;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.2s;
}

.btn-remove:hover {
    background: #fee2e2;
}

/* Page Confirmación */
.confirmation-page {
    text-align: center;
    padding: 3rem 1rem;
}

.success-icon {
    font-size: 4rem;
    color: #27ae60;
    margin-bottom: 1.5rem;
}

.confirmation-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.confirmation-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
}
