/* Variables CSS */
:root {
    /* Colores */
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --text-color-light: #7f8c8d;
    --bg-color: #ffffff;
    --bg-color-alt: #f9f9f9;
    --border-color: #ecf0f1;

    /* Tipografía */
    --body-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --biggest-font-size: 2.5rem;
    --h1-font-size: 1.75rem;
    --h2-font-size: 1.25rem;
    --h3-font-size: 1.125rem;
    --normal-font-size: .938rem;
    --small-font-size: .813rem;

    /* Márgenes */
    --mb-1: .5rem;
    --mb-2: 1rem;
    --mb-3: 1.5rem;
    --mb-4: 2rem;
    --mb-5: 2.5rem;
    --mb-6: 3rem;

    /* z-index */
    --z-tooltip: 10;
    --z-fixed: 100;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--text-color);
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: var(--body-font);
}

/* Clases Reutilizables */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 5rem 0;
}

.section__title {
    font-size: var(--h1-font-size);
    text-align: center;
    margin-bottom: var(--mb-4);
}

.button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: .75rem 1.5rem;
    border-radius: .5rem;
    transition: .3s;
}

.button:hover {
    background-color: #2980b9;
}

.button--primary {
    background-color: var(--primary-color);
}

.button--secondary {
    background-color: var(--secondary-color);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    z-index: var(--z-fixed);
}

.nav {
    height: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo {
    display: flex;
    align-items: center;
    font-size: var(--h2-font-size);
    font-weight: 600;
    color: var(--primary-color);
}

.nav__logo i {
    margin-right: .5rem;
}

.nav__list {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav__link {
    font-weight: 500;
    transition: .3s;
}

.nav__link:hover,
.nav__link.active {
    color: var(--primary-color);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav__search {
    position: relative;
}

.nav__search-input {
    padding: .5rem 2rem .5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    outline: none;
    width: 200px;
}

.nav__search-icon {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-light);
}

.nav__cart,
.nav__user {
    position: relative;
    cursor: pointer;
}

.nav__cart-icon,
.nav__user-icon {
    font-size: 1.25rem;
    color: var(--text-color);
}

.nav__cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-size: .75rem;
    padding: .25rem .5rem;
    border-radius: 50%;
}

/* Hero Section */
.hero {
    padding: 7rem 0 5rem;
    background-color: var(--bg-color-alt);
}

.hero__content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.hero__title {
    font-size: var(--biggest-font-size);
    margin-bottom: var(--mb-3);
}

.hero__description {
    margin-bottom: var(--mb-4);
    color: var(--text-color-light);
}

/* Categories Section */
.categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.category__card {
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    background-color: var(--bg-color);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: .3s;
}

.category__card:hover {
    transform: translateY(-5px);
}

.category__icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--mb-2);
}

.category__title {
    font-size: var(--h3-font-size);
    margin-bottom: var(--mb-1);
}

/* Products Section */
.products__filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: var(--mb-4);
}

.filter__button {
    padding: .5rem 1.5rem;
    border-radius: 2rem;
    font-weight: 500;
    color: var(--text-color);
    transition: .3s;
}

.filter__button.active,
.filter__button:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.products__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.product__card {
    background-color: var(--bg-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: .3s;
}

.product__card:hover {
    transform: translateY(-5px);
}

.product__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product__content {
    padding: 1.5rem;
}

.product__title {
    font-size: var(--h3-font-size);
    margin-bottom: var(--mb-1);
}

.product__price {
    color: var(--primary-color);
    font-size: var(--h2-font-size);
    font-weight: 600;
    margin-bottom: var(--mb-2);
}

.product__button {
    width: 100%;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--bg-color);
    box-shadow: -2px 0 8px rgba(0,0,0,.1);
    padding: 2rem;
    transform: translateX(100%);
    transition: .3s;
    z-index: var(--z-fixed);
}

.cart-modal.show {
    transform: translateX(0);
}

.cart-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--mb-3);
}

.cart-modal__close {
    font-size: 2rem;
    color: var(--text-color);
}

.cart-modal__items {
    height: calc(100vh - 250px);
    overflow-y: auto;
}

.cart-modal__footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.cart-modal__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--mb-3);
    font-size: var(--h3-font-size);
    font-weight: 600;
}

/* Footer */
.footer {
    background-color: var(--bg-color-alt);
    padding: 5rem 0 2rem;
}

.footer__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: var(--mb-5);
}

.footer__title {
    font-size: var(--h3-font-size);
    margin-bottom: var(--mb-2);
}

.footer__description {
    margin-bottom: var(--mb-3);
}

.footer__links li {
    margin-bottom: var(--mb-1);
}

.footer__links a:hover {
    color: var(--primary-color);
}

.footer__contact li {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: var(--mb-1);
}

.footer__social {
    display: flex;
    gap: 1rem;
}

.footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--bg-color);
    transition: .3s;
}

.footer__social-link:hover {
    background-color: #2980b9;
}

.footer__bottom {
    text-align: center;
    padding-top: var(--mb-4);
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media screen and (max-width: 768px) {
    :root {
        --biggest-font-size: 2rem;
        --h1-font-size: 1.5rem;
        --h2-font-size: 1.25rem;
        --h3-font-size: 1rem;
        --normal-font-size: .938rem;
        --small-font-size: .813rem;
    }

    .nav__menu {
        position: fixed;
        top: 4rem;
        left: -100%;
        width: 80%;
        height: 100vh;
        padding: 2rem;
        background-color: var(--bg-color);
        transition: .3s;
    }

    .nav__menu.show {
        left: 0;
    }

    .nav__list {
        flex-direction: column;
    }

    .nav__search-input {
        width: 150px;
    }
}

@media screen and (max-width: 350px) {
    .container {
        margin-left: var(--mb-1);
        margin-right: var(--mb-1);
    }

    .nav__search-input {
        width: 100px;
    }
}

/* Estilos para el proceso de compra */

/* Página de detalle de producto */
.breadcrumbs {
    padding: 1rem 0;
    margin-top: 4rem;
    font-size: var(--small-font-size);
    }
    
    .breadcrumbs a {
    color: var(--text-color-light);
    }
    
    .breadcrumbs a:hover {
    color: var(--primary-color);
    }
    
    .product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 0;
    }
    
    .product-gallery {
    position: relative;
    }
    
    .main-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 1rem;
    margin-bottom: 1rem;
    }
    
    .main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    }
    
    .thumbnail-images {
    display: flex;
    gap: 0.5rem;
    }
    
    .thumbnail-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: .3s;
    }
    
    .thumbnail-images img:hover {
    opacity: 0.8;
    }
    
    .product-title {
    font-size: var(--biggest-font-size);
    margin-bottom: 0.5rem;
    }
    
    .product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
    }
    
    .product-rating i {
    color: #f39c12;
    }
    
    .product-price {
    font-size: var(--h1-font-size);
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    }
    
    .product-description {
    margin-bottom: 2rem;
    color: var(--text-color-light);
    line-height: 1.8;
    }
    
    .product-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    }
    
    .quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    }
    
    .quantity-btn {
    width: 40px;
    height: 40px;
    background-color: var(--bg-color-alt);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: .3s;
    }
    
    .quantity-btn:hover {
    background-color: var(--border-color);
    }
    
    .quantity-selector input {
    width: 50px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: var(--normal-font-size);
    }
    
    .product-meta {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    }
    
    .product-meta p {
    margin-bottom: 0.5rem;
    font-size: var(--small-font-size);
    }
    
    .stock-status.in-stock {
    color: var(--secondary-color);
    }
    
    .stock-status.out-of-stock {
    color: var(--accent-color);
    }
    
    .product-tabs {
    margin: 3rem 0;
    }
    
    .tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    }
    
    .tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    font-size: var(--normal-font-size);
    font-weight: 500;
    color: var(--text-color-light);
    cursor: pointer;
    transition: .3s;
    }
    
    .tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    }
    
    .tab-panel {
    display: none;
    }
    
    .tab-panel.active {
    display: block;
    }
    
    .specs-list {
    list-style: none;
    }
    
    .specs-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    }
    
    /* Página de carrito */
    .cart-page {
    padding: 6rem 0 3rem;
    }
    
    .page-title {
    font-size: var(--biggest-font-size);
    margin-bottom: 2rem;
    }
    
    .cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    }
    
    .cart-items {
    background-color: var(--bg-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    }
    
    .cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    }
    
    .item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    }
    
    .item-name {
    font-size: var(--h3-font-size);
    margin-bottom: 0.5rem;
    }
    
    .item-price {
    color: var(--text-color-light);
    }
    
    .item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    }
    
    .item-total {
    font-weight: 600;
    color: var(--primary-color);
    }
    
    .remove-btn {
    position: absolute;
    top: 1rem;
    right: 0;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-color-light);
    cursor: pointer;
    transition: .3s;
    }
    
    .remove-btn:hover {
    color: var(--accent-color);
    }
    
    .cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    }
    
    .cart-summary, .coupon-section {
    background-color: var(--bg-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    }
    
    .cart-summary h3, .coupon-section h3 {
    margin-bottom: 1.5rem;
    font-size: var(--h3-font-size);
    }
    
    .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    }
    
    .summary-row.total {
    font-weight: 600;
    font-size: var(--h3-font-size);
    border-bottom: none;
    padding-top: 1rem;
    }
    
    .checkout-button {
    width: 100%;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    }
    
    .continue-shopping {
    display: block;
    text-align: center;
    color: var(--text-color-light);
    transition: .3s;
    }
    
    .continue-shopping:hover {
    color: var(--primary-color);
    }
    
    .coupon-form {
    display: flex;
    gap: 0.5rem;
    }
    
    .coupon-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    outline: none;
    }
    
    /* Checkout y Pago */
    .checkout-header {
    position: relative; /* En lugar de fixed */
    width: 100%;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    }
    
    .checkout-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    }
    
    .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-color-light);
    }
    
    .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--bg-color-alt);
    margin-bottom: 0.5rem;
    }
    
    .step.active {
    color: var(--primary-color);
    }
    
    .step.active .step-number {
    background-color: var(--primary-color);
    color: var(--bg-color);
    }
    
    .step.completed .step-number {
    background-color: var(--secondary-color);
    color: var(--bg-color);
    }
    
    .checkout-container {
    padding: 3rem 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    }
    
    .checkout-form-container {
    background-color: var(--bg-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    }
    
    .checkout-form-container h1 {
    margin-bottom: 2rem;
    font-size: var(--h1-font-size);
    }
    
    .checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    }
    
    .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    }
    
    .form-group label {
    font-weight: 500;
    font-size: var(--small-font-size);
    }
    
    .form-group input,
    .form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: var(--normal-font-size);
    outline: none;
    transition: .3s;
    }
    
    .form-group input:focus,
    .form-group select:focus {
    border-color: var(--primary-color);
    }
    
    .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    }
    
    .shipping-methods {
    margin-top: 1rem;
    }
    
    .shipping-option {
    margin-bottom: 1rem;
    }
    
    .shipping-option input[type="radio"] {
    display: none;
    }
    
    .shipping-option label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: .3s;
    }
    
    .shipping-option input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.05);
    }
    
    .shipping-option-info {
    display: flex;
    flex-direction: column;
    }
    
    .shipping-name {
    font-weight: 500;
    }
    
    .shipping-time {
    font-size: var(--small-font-size);
    color: var(--text-color-light);
    }
    
    .shipping-price {
    font-weight: 600;
    color: var(--primary-color);
    }
    
    .form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    }
    
    .checkout-sidebar .order-summary {
    background-color: var(--bg-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    }
    
    .order-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    }
    
    .order-item .item-image {
    position: relative;
    }
    
    .order-item .item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
    }
    
    .order-item .item-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    }
    
    .order-item .item-info {
    flex: 1;
    }
    
    .order-item .item-info h4 {
    font-size: var(--normal-font-size);
    margin-bottom: 0.25rem;
    }
    
    .order-item .item-info p {
    color: var(--primary-color);
    font-weight: 500;
    }
    
    /* Pago */
    .payment-option {
    margin-bottom: 1.5rem;
    }
    
    .payment-option input[type="radio"] {
    margin-right: 0.5rem;
    }
    
    .payment-option label {
    font-weight: 500;
    }
    
    .payment-details {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-color-alt);
    border-radius: 0.5rem;
    }
    
    /* Confirmación */
    .confirmation-container {
    padding: 3rem 0;
    max-width: 800px;
    margin: 0 auto;
    }
    
    .order-confirmation {
    background-color: var(--bg-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    text-align: center;
    }
    
    .confirmation-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    }
    
    .order-confirmation h1 {
    font-size: var(--biggest-font-size);
    margin-bottom: 1rem;
    }
    
    .order-confirmation p {
    color: var(--text-color-light);
    margin-bottom: 2rem;
    }
    
    .order-details {
    text-align: left;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-color-alt);
    border-radius: 0.5rem;
    }
    
    .order-details h3 {
    margin-bottom: 1rem;
    font-size: var(--h3-font-size);
    }
    
    .order-details p {
    margin-bottom: 0.5rem;
    }
    
    .order-items-container {
    text-align: left;
    margin-bottom: 2rem;
    }
    
    .order-items-container h3 {
    margin-bottom: 1rem;
    font-size: var(--h3-font-size);
    }
    
    .confirmation-actions {
    margin-top: 2rem;
    }
    
    /* Responsive para checkout */
    @media screen and (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .cart-container {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .item-quantity, .item-total {
        grid-column: 2;
    }
    
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-actions .button {
        width: 100%;
    }
    }
    
    /* Estilos para productos en catálogo */
    .product__img-link {
    display: block;
    overflow: hidden;
    border-radius: 1rem 1rem 0 0;
    }
    
    .product__title a {
    color: var(--text-color);
    transition: .3s;
    }
    
    .product__title a:hover {
    color: var(--primary-color);
    }
    
    .product__buttons {
    display: flex;
    gap: 0.5rem;
    }
    
    .product__buttons .button--secondary {
    flex: 1;
    }
    
    .product__buttons .product__button {
    width: auto;
    padding: 0.75rem;
    }