/* 页面通用样式 */
.container {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* 移动端导航 */
.mobile-header {
    background: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 50px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mobile-header .back-btn {
    position: absolute;
    left: 15px;
    color: #333;
    font-size: 18px;
}

.mobile-header h1 {
    font-size: 18px;
    margin: 0;
    flex: 1;
    text-align: center;
}

/* PC端头部 */
.pc-header {
    margin-top: 15px;
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pc-header h2 {
    font-size: 20px;
    margin: 0;
    color: #333;
}

/* 左侧导航激活状态 */
.nav-menu li.active a {
    color: #d95517;
    background: rgba(217, 85, 23, 0.1);
}

/* 购物车容器 */
.cart-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 购物车头部 */
.cart-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.cart-header > div {
    padding: 0 10px;
}

.cart-header .col-select {
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cart-header .col-image {
    /* width: 80px; */
    margin-left: 10px;
}

.cart-header .col-info {
    flex: 2;
}

.cart-header .col-price,
.cart-header .col-quantity,
.cart-header .col-total {
    flex: 1;
    text-align: center;
}

.cart-header .col-action {
    width: 80px;
    text-align: center;
}

/* 购物车商品项 */
.cart-item {
    display: flex;
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
}

/* 商品左侧 */
.item-left {
    display: flex;
    align-items: center;
}

.item-left .col-select {
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.item-left .col-image {
    width: 80px;
    height: 80px;
    margin-left: 10px;
}

.item-left .col-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* PC端商品右侧 */
.item-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.item-right .col-info {
    
    padding: 0 15px;
}

.item-right .col-info h3 {
    font-size: 16px;
    margin: 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-right .col-price,
.item-right .col-total {
    flex: 0.5;
    text-align: center;
    color: #d95517;
    font-weight: 500;
}

.item-right .col-quantity {
    flex: 0.5;
    display: flex;
    justify-content: center;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 4px;
}

.quantity-wrapper button {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: #666;
    font-size: 12px;
}

.quantity-wrapper button:hover {
    color: #d95517;
}

.quantity-wrapper .quantity-input {
    width: 50px;
    height: 30px;
    border: none;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    text-align: center;
}

.item-right .col-action {
    width: 80px;
    text-align: center;
}

.btn-delete {
    border: none;
    background: none;
   
    font-size: 16px;
}

.btn-delete:hover {
    color: #d95517;
}

/* 移动端商品布局 */
@media (max-width: 767.98px) {
    .container {
        padding-top: 60px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .cart-container {
        background: #f7f7f7;
    }

    .cart-item {
        padding: 12px;
        background: #fff;
        margin-bottom: 8px;
        display: flex;
        position: relative;
    }

    .item-right .col-info {
       
        padding: 0 ;
    }

    .item-left {
        display: flex;
        align-items: flex-start;
    }

    .item-left .col-select {
        width: 24px;
        margin-right: 8px;
        padding-top: 30px;  
    }

    .item-left .col-select .layui-form-checkbox[lay-skin=primary] i {
        width: 16px;
        height: 16px;
        line-height: 16px;
    }

    .item-left .col-image {
        width: 80px;
        height: 80px;
        margin-left: 0;
        border-radius: 4px;
        overflow: hidden;
        background: #fafafa;
    }

    .item-left .col-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 4px;
    }

    .item-right {
        flex: 1;
        margin-left: 10px;
        margin-right: 11px;
        display: flex;
        min-width: 0;
    }

    .item-center {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 90px;  
    }


    .item-center .col-info h3 {
        font-size: 14px;
        line-height: 1.4;
        margin: 0;
       
        -webkit-line-clamp: 2;
        color: #333;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        word-break: break-all;
    }

    .item-center .col-price {
        font-size: 15px;  
        color: #d95517;
        font-weight: 500;
        margin: 3px 0;
        text-align: left;
    }

    .item-center .quantity-wrapper {
        display: inline-flex;
        align-items: center;
        background: #f7f7f7;
        border-radius: 2px;
        padding: 1px;
        height: 22px;
        border: 1px solid #eee;
    }

    .item-center .quantity-wrapper .quantity-input {
        width: 32px;
        height: 20px;
        line-height: 20px;
        font-size: 12px;
        
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
        text-align: center;
        padding: 0;
        margin: 0;
        color: #333;
        -webkit-appearance: none;
        -moz-appearance: textfield;
    }

    .item-center .quantity-wrapper .quantity-input::-webkit-inner-spin-button,
    .item-center .quantity-wrapper .quantity-input::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .item-center .quantity-wrapper button {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 12px;
        border: none;
        background: #fff;
        border-radius: 1px;
        color: #666;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
    }

    .item-center .quantity-wrapper button:hover {
        background: #f0f0f0;
    }

    .item-center .quantity-wrapper button:active {
        background: #e8e8e8;
    }

    .item-center .quantity-wrapper button i {
        font-size: 9px;
        line-height: 1;
    }

    .item-center .quantity-wrapper button:disabled {
        color: #ccc;
        background: #f8f8f8;
        cursor: not-allowed;
    }

    .item-action {
        position: absolute;
        bottom: 10px;  
        right: 10px;
    }

    .btn-delete {
        font-size: 13px;  
        padding: 3px;
        color: #ff4d4f;
    }
}

/* 移动端底部结算栏 */
@media (max-width: 767.98px) {
    .cart-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
    }

    .container {
        padding-bottom: 80px;
    }

    .total-info {
        font-size: 14px;
    }

    .total-info .total-price {
        font-size: 18px;
    }

    .checkout-btn {
        min-width: 100px;
        height: 36px;
        font-size: 14px;
    }
}

/* 底部结算栏 */
.cart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

.cart-total {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
}

.cart-total-select {
    display: flex;
    align-items: center;
    margin-right: 10px;
    margin-left: 15px;
}

.cart-total-select .btn-delete {
    border: none;
    background: none;
  
    font-size: 16px;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-left: 30px;
}

.cart-total-select .btn-delete:hover {
    color: #d95517;
}

.total-info {
    font-size: 16px;
    color: #333;
    text-align: right;
    margin-right: 15px;
}

.total-info .total-price {
    color: #d95517;
    font-weight: 500;
    font-size: 20px;
}

.checkout-btn {
    min-width: 120px;
    height: 40px;
    background: #d95517;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
   
}

.checkout-btn:hover {
    background: #c14612;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 移动端样式调整 */
@media (max-width: 767.98px) {
    .pc-only {
        display: none !important;
    }

    .cart-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-total {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cart-total-select {
        margin-right: 10px;
        margin-left: 15px;
    }

    .cart-total-select .btn-delete {
        margin-left: 25px;
    }

    .total-info {
        text-align: right;
        margin-right: 10px;
    }

    .checkout-btn {
        margin-top: 10px;
        width: 100%;
    }
}

/* PC端隐藏元素 */
@media (max-width: 767.98px) {
    .pc-only {
        display: none !important;
    }
}

/* PC端布局 */
@media (min-width: 768px) {
    .item-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .item-center {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 86%;
    }

    .col-info {
        display: flex;
        align-items: center;
        gap:48px;
        width: 83%;
    }

    .col-info h3 {
        flex: 2;
        font-size: 14px;
        color: #333;
    }

    .pc-only {
        display: block;
    }

    .item-action {
        display: flex;
        align-items: center;
        padding: 0 35px;
    }

    .btn-delete {
        background: none;
        border: none;
        color: #ff4d4f;
        cursor: pointer;
        transition: color 0.3s ease;
    }

    .btn-delete:hover {
        color: #ff0000;
    }
}

/* 移动端布局 */
@media (max-width: 767.98px) {
    .cart-item {
        padding: 12px;
        background: #fff;
        margin-bottom: 8px;
        position: relative;
    }

    .item-left {
        display: flex;
        align-items: flex-start;
    }

    .item-left .col-select {
        width: 24px;
        margin-right: 8px;
        padding-top: 30px;
    }

    .item-right {
        flex: 1;
        margin-left: 10px;
        margin-right: 11px;
    }

    .item-center {
        flex: 1;
    }

    .col-info {
        display: flow;
        
    }

    .col-info h3 {
        font-size: 14px;
        line-height: 1.4;
        margin: 0 0 5px 0;
        color: #333;
    }

    .col-info .col-price {
        font-size: 15px;
        color: #d95517;
        font-weight: 500;
        margin: 3px 0;
    }

    .item-action {
        position: absolute;
        bottom: 10px;
        right: 10px;
    }
}
