

html, body {
    overflow-x: hidden;
}

/* -------------------------
   EMPTY STATE (FULL PAGE)
--------------------------*/
.cart-empty-state {
    max-width: 500px;
    margin: 120px auto;
    text-align: center;
    padding: 0 20px;
}

.empty-title {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* reuse checkout button but adjust width */
.empty-btn {
    max-width: 280px;
    margin: 0 auto;
}

/* -------------------------
   CART WRAPPER
--------------------------*/
.cart-wrapper {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* -------------------------
   EMPTY CART
--------------------------*/
.cart-empty {
    text-align: center;
    padding: 60px 20px;
}

.cart-empty p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #555;
}

.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #333;
}

/* -------------------------
   CART ITEMS
--------------------------*/
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* -------------------------
   META
--------------------------*/

.cart-remove-btn {
    margin-top: 8px;
    background: transparent;
    border: none;
    color: #c00;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

.cart-remove-btn:hover {
    text-decoration: underline;
}



/* -------------------------
   LAYOUT
--------------------------*/
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
    box-sizing: border-box;
}

/* -------------------------
   HEADER
--------------------------*/
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h1 {
    font-size: 28px;
}

.cart-count {
    font-size: 14px;
    color: #555;
}

/* -------------------------
   DIVIDER
--------------------------*/
.cart-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 20px 0;
}

/* -------------------------
   TABLE HEADER
--------------------------*/
.cart-table-header,
.cart-row {
    display: grid;
    grid-template-columns: 3fr 2fr 1fr 1fr 1fr 0.8fr;
    gap: 16px;
    align-items: center;
}

.cart-table-header {
    font-size: 14px;
    font-weight: 900;
    color: #777;
    padding-bottom: 10px;
}

/* -------------------------
   ROW
--------------------------*/
.cart-row {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.cart-product {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.cart-product img {
    width: 120px;
    height: 85px;
    border-radius: 6px;
    object-fit: cover;
}

.cart-product-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-product-name {
    font-size: 13px;
    font-weight: 700;
}

/* OPTIONS */
.cart-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: #666;
}

.cart-option strong {
    color: #444;
}

/* -------------------------
   CELLS
--------------------------*/
.cart-cell {
    font-size: 14px;
    color: #333;
    word-break: break-word;
    max-width: 140px;
}

.cart-remove {
    text-align: center;
}

.cart-remove-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
}

.trash-icon {
    width: 25px;
    height: 25px;
    stroke: #808080;
    stroke-width: 2;
    fill: none;
    transition: stroke 0.2s ease, transform 0.2s ease;
}

.cart-remove-btn:hover .trash-icon {
    stroke: #d00;
    transform: scale(1.1);
}

.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-icon {
    background: none;
    border: none;
    padding: 0;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    color: #000;
    line-height: 1;
}

.qty-icon:hover {
    color: #666;
}

.qty-value {
    min-width: 18px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}
/* -------------------------
   SUMMARY
--------------------------*/
.cart-right {
    background: #fff;
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    align-self: flex-start;
    box-sizing: border-box;
}

.summary-title {
    font-size: 22px;
}

.summary-row,
.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    margin-bottom: 10px;
}

.summary-total {
    font-weight: 700;
    font-size: 18px;
}

.btn-checkout {
    position: relative;        /* ⬅️ referencia para ::after */
    overflow: hidden;          /* ⬅️ evita que se salga */
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    background: linear-gradient(135deg, #D4AF37, #f9e076);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.btn-checkout::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    transition: transform 0.6s ease;
}

.btn-checkout:hover::after {
    transform: translateX(240%);
}

.btn-checkout:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {

    /* Oculta header tipo tabla */
    .cart-table-header {
        display: none;
    }

    /* Layout general */
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* CART ROW = grid con zonas */
    .cart-row {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "product"
            "comment"
            "bottom";
        gap: 12px;
        padding: 16px 0;
        border-bottom: 1px solid #eee;
    }

    /* PRODUCTO */
    .cart-row > .cart-cell:first-child {
        grid-area: product;
    }

    .cart-product {
        display: grid;
        grid-template-columns: 90px 1fr;
        gap: 12px;
        align-items: flex-start;
    }

    .cart-product img {
        width: 90px;
        height: 90px;
        border-radius: 6px;
        object-fit: cover;
    }

    /* COMENTARIO */
    .cart-row > .cart-cell:nth-child(2) {
        grid-area: comment;
        margin-left: -20px; /* 158 CENTRADO CON EL DE ARRIBA */
        font-size: 12px;
        color: #555;
        line-height: 1.3;

        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* OCULTA PRECIO UNITARIO */
    .cart-row > .cart-cell:nth-child(4) {
        display: none;
    }

    /* FILA INFERIOR (TOTAL + QTY + DELETE) */
    .cart-row > .cart-cell:nth-child(5),
    .cart-row > .cart-cell:nth-child(3),
    .cart-row > .cart-cell:nth-child(6) {
        grid-area: bottom;
    }

    .cart-row > .cart-cell:nth-child(5) {
        font-weight: 600;
    }

    /* Contenedor real de la fila inferior */
    .cart-row {
        position: relative;
    }

    .cart-row::after {
        content: "";
        grid-area: bottom;
        display: flex;
    }

    /* Agrupar visualmente */
    .cart-row > .cart-cell:nth-child(5),
    .cart-row > .cart-cell:nth-child(3),
    .cart-row > .cart-cell:nth-child(6) {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    /* Alinear como una sola línea */
    .cart-row > .cart-cell:nth-child(5) {
        justify-self: start;
    }

    .cart-row > .cart-cell:nth-child(3) {
        justify-self: center;
    }

    .cart-row > .cart-cell:nth-child(6) {
        justify-self: end;
    }

    .trash-icon {
        width: 22px;
        height: 22px;
    }

    /* Summary */
    .cart-right {
        width: 100%;
    }
}




