/*====================================
        TOM STORE CART CSS
====================================*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #f5f5f5;
    color: #222;
}

/*=========================
        HEADER
=========================*/

.header {
    width: 100%;
    background: #000;
    padding: 20px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.logo {
    text-decoration: none;
    color: #fff;
    font-size: 34px;
    font-weight: 800;
}

.logo span {
    color: #d90429;
}

.back-btn {
    text-decoration: none;
    color: #fff;
    background: #d90429;
    padding: 12px 25px;
    border-radius: 40px;
    transition: .3s;
    font-weight: 600;
}

.back-btn:hover {
    background: #b10322;
    transform: translateY(-3px);
}

/*=========================
      CART SECTION
=========================*/

.cart-section {
    padding: 60px 8%;
}

.cart-title {
    text-align: center;
    margin-bottom: 50px;
}

.cart-title h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.cart-title p {
    color: #666;
    font-size: 17px;
}

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

/*=========================
      CART ITEMS
=========================*/

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.cart-item {
    background: #fff;
    border-radius: 18px;
    padding: 25px;
    display: grid;
    grid-template-columns: 120px 1fr 150px 60px;
    align-items: center;
    gap: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .08);
}

.product-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 15px;
}

.product-details h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.product-price {
    color: #d90429;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

/*=========================
      QUANTITY
=========================*/

.quantity-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-box button {
    width: 40px;
    height: 40px;
    border: none;
    background: #d90429;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: .3s;
}

.quantity-box button:hover {
    background: #b10322;
}

.quantity {
    font-size: 20px;
    font-weight: 700;
    min-width: 25px;
    text-align: center;
}

/*=========================
      ITEM TOTAL
=========================*/

.item-total {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    text-align: center;
}

.remove-btn {
    border: none;
    background: none;
    color: #d90429;
    font-size: 24px;
    cursor: pointer;
    transition: .3s;
}

.remove-btn:hover {
    transform: scale(1.2);
}

/*=========================
      SUMMARY
=========================*/

.cart-summary {
    background: #fff;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    margin-bottom: 30px;
    font-size: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 18px;
}

.cart-summary hr {
    margin: 20px 0;
}

.grand-total {
    font-size: 24px;
    font-weight: 700;
}

/*=========================
      BUTTONS
=========================*/

.checkout-btn {
    width: 100%;
    margin-top: 30px;
    padding: 16px;
    border: none;
    background: #d90429;
    color: #fff;
    border-radius: 50px;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
}

.checkout-btn:hover {
    background: #b10322;
}

.clear-btn {
    width: 100%;
    margin-top: 15px;
    padding: 16px;
    border: none;
    background: #111;
    color: #fff;
    border-radius: 50px;
    font-size: 17px;
    cursor: pointer;
    transition: .3s;
}

.clear-btn:hover {
    background: #333;
}


/*====================================
    CHECKOUT & TERMS POPUP
====================================*/

.terms-popup {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, .7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.terms-popup.active {
    display: flex;
}

.terms-box {
    width: 100%;
    max-width: 800px;
    max-height: 92vh;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    animation: popup .35s ease;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
}

@keyframes popup {

    from {
        transform: scale(.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }

}

.terms-box > h2 {
    background: #d90429;
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 28px;
    flex-shrink: 0;
}

.popup-scroll-content {
    overflow-y: auto;
    padding: 25px 30px 0;
}

/* DELIVERY SECTION */

.delivery-section h3,
.terms-section h3 {
    font-size: 21px;
    margin-bottom: 20px;
    color: #222;
}

.delivery-section h3 i,
.terms-section h3 i {
    color: #d90429;
    margin-right: 8px;
}

.delivery-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #333;
}

.form-group label span {
    color: #d90429;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: .3s;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #d90429;
    box-shadow: 0 0 0 3px rgba(217, 4, 41, .08);
}

/* FORM VALIDATION */

.form-group input.input-error,
.form-group textarea.input-error {
    border-color: #d90429;
    background: #fff5f6;
}

.field-error {
    display: none;
    color: #d90429;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
}

.field-error.show {
    display: block;
}

/* TERMS */

.terms-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.terms-content {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 12px;
}

.terms-content p {
    font-size: 14px;
    color: #444;
    margin-bottom: 12px;
    line-height: 1.7;
}

.terms-content p:last-child {
    margin-bottom: 0;
}

/* AGREE */

.agree-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 25px 0;
    font-size: 15px;
    font-weight: 500;
    color: #222;
    cursor: pointer;
}

.agree-box input {
    width: 21px;
    height: 21px;
    min-width: 21px;
    accent-color: #d90429;
    cursor: pointer;
    margin-top: 2px;
}

/* BUTTONS */

.popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.cancel-btn,
.continue-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: .3s;
}

.cancel-btn {
    background: #555;
}

.cancel-btn:hover {
    background: #333;
}

.continue-btn {
    background: #25D366;
}

.continue-btn i {
    margin-right: 7px;
}

.continue-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.continue-btn:disabled {
    background: #bfbfbf;
    cursor: not-allowed;
}

/* MOBILE */

@media (max-width: 768px) {

    .terms-popup {
        padding: 10px;
    }

    .terms-box {
        max-height: 95vh;
        border-radius: 15px;
    }

    .terms-box > h2 {
        font-size: 21px;
        padding: 16px;
    }

    .popup-scroll-content {
        padding: 20px 18px 0;
    }

    .delivery-form {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: auto;
    }

    .popup-buttons {
        flex-direction: column;
        padding: 15px 18px;
    }

    .cancel-btn,
    .continue-btn {
        width: 100%;
    }

}

/*=========================
      MOBILE
=========================*/

@media(max-width:768px){

    .terms-box{
        max-width:100%;
    }

    .terms-box h2{
        font-size:24px;
    }

    .terms-content{
        padding:20px;
        max-height:260px;
    }

    .popup-buttons{
        flex-direction:column;
    }

    .cancel-btn,
    .continue-btn{
        width:100%;
    }

}

/*=========================
      EMPTY CART
=========================*/

.empty-cart {
    background: #fff;
    border-radius: 20px;
    padding: 70px 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .08);
}

.empty-cart i {
    font-size: 90px;
    color: #d90429;
    margin-bottom: 20px;
}

.empty-cart h2 {
    font-size: 34px;
    margin-bottom: 15px;
}

.empty-cart p {
    color: #666;
    margin-bottom: 30px;
}

.empty-cart a {
    display: inline-block;
    background: #d90429;
    color: #fff;
    text-decoration: none;
    padding: 15px 35px;
    border-radius: 50px;
    transition: .3s;
}

.empty-cart a:hover {
    background: #b10322;
}

/*=========================================
        MOBILE RESPONSIVE
=========================================*/

/* Tablets */

@media (max-width:992px){

    .cart-section{
        padding:40px 20px;
    }

    .cart-container{
        grid-template-columns:1fr;
        gap:25px;
    }

    .cart-summary{
        position:static;
        width:100%;
    }

    .cart-item{
        grid-template-columns:1fr;
        text-align:center;
        gap:18px;
    }

    .product-image{
        width:180px;
        height:180px;
        margin:auto;
    }

    .quantity-box{
        justify-content:center;
    }

    .item-total{
        font-size:22px;
    }

}

/* Mobile */

@media (max-width:768px){

    body{
        overflow-x:hidden;
    }

    .header{
        padding:15px;
        flex-direction:column;
        gap:15px;
    }

    .logo{
        font-size:28px;
    }

    .back-btn{
        width:100%;
        text-align:center;
    }

    .cart-section{
        padding:30px 15px;
    }

    .cart-title{
        margin-bottom:30px;
    }

    .cart-title h1{
        font-size:30px;
    }

    .cart-title p{
        font-size:15px;
    }

    .cart-item{
        padding:18px;
        border-radius:15px;
    }

    .product-image{
        width:150px;
        height:150px;
    }

    .product-details h3{
        font-size:20px;
    }

    .product-price{
        font-size:18px;
        margin-bottom:15px;
    }

    .quantity-box{
        gap:12px;
    }

    .quantity-box button{
        width:36px;
        height:36px;
    }

    .quantity{
        font-size:18px;
    }

    .item-total{
        font-size:20px;
    }

    .remove-btn{
        font-size:22px;
    }

    .cart-summary{
        padding:25px;
    }

    .cart-summary h2{
        font-size:24px;
        margin-bottom:20px;
    }

    .summary-row{
        font-size:16px;
    }

    .grand-total{
        font-size:20px;
    }

    .checkout-btn,
    .clear-btn{
        padding:14px;
        font-size:16px;
    }

    /* Empty Cart */

    .empty-cart{
        padding:45px 20px;
    }

    .empty-cart i{
        font-size:70px;
    }

    .empty-cart h2{
        font-size:26px;
    }

    .empty-cart a{
        width:100%;
    }

    /* Terms Popup */

    .terms-box{
        border-radius:15px;
    }

    .terms-box h2{
        font-size:22px;
        padding:18px;
    }

    .terms-content{
        padding:18px;
        max-height:240px;
    }

    .agree-box{
        padding:0 18px 20px;
        font-size:15px;
    }

    .popup-buttons{
        flex-direction:column;
        padding:20px;
    }

    .cancel-btn,
    .continue-btn{
        width:100%;
    }

}

/* Small Mobile */

@media (max-width:480px){

    .logo{
        font-size:24px;
    }

    .cart-title h1{
        font-size:26px;
    }

    .cart-title p{
        font-size:14px;
    }

    .product-image{
        width:130px;
        height:130px;
    }

    .product-details h3{
        font-size:18px;
    }

    .product-price{
        font-size:17px;
    }

    .quantity-box button{
        width:34px;
        height:34px;
    }

    .quantity{
        font-size:16px;
    }

    .item-total{
        font-size:18px;
    }

    .cart-summary{
        padding:20px;
    }

    .summary-row{
        font-size:15px;
    }

    .checkout-btn,
    .clear-btn{
        font-size:15px;
        padding:13px;
    }

    .empty-cart{
        padding:35px 15px;
    }

    .empty-cart h2{
        font-size:22px;
    }

    .empty-cart i{
        font-size:60px;
    }

}

/*=========================================
        POPUP RESPONSIVE - TABLET
=========================================*/

@media (max-width: 768px) {

    .terms-popup {
        padding: 10px;
        align-items: center;
    }

    .terms-box {
        width: 100%;
        max-width: 600px;
        max-height: 95vh;
        border-radius: 15px;
    }

    .terms-box > h2 {
        font-size: 22px;
        padding: 16px 12px;
    }

    .popup-scroll-content {
        padding: 20px 18px 0;
        overflow-y: auto;
    }

    .delivery-section h3,
    .terms-section h3 {
        font-size: 19px;
        margin-bottom: 15px;
    }

    .delivery-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-group.full-width {
        grid-column: auto;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 14px;
    }

    .terms-section {
        margin-top: 25px;
        padding-top: 20px;
    }

    .terms-content {
        padding: 15px;
    }

    .terms-content p {
        font-size: 13px;
        line-height: 1.6;
    }

    .agree-box {
        padding: 20px 0;
        font-size: 14px;
    }

    .popup-buttons {
        flex-direction: column;
        gap: 10px;
        padding: 15px 18px;
    }

    .cancel-btn,
    .continue-btn {
        width: 100%;
        padding: 13px;
    }
}


/*=========================================
        POPUP RESPONSIVE - SMALL MOBILE
=========================================*/

@media (max-width: 480px) {

    .terms-popup {
        padding: 5px;
    }

    .terms-box {
        max-height: 98vh;
        border-radius: 12px;
    }

    .terms-box > h2 {
        font-size: 18px;
        padding: 14px 10px;
    }

    .popup-scroll-content {
        padding: 15px 12px 0;
    }

    .delivery-section h3,
    .terms-section h3 {
        font-size: 17px;
    }

    .delivery-form {
        gap: 12px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group textarea {
        padding: 11px 12px;
        font-size: 13px;
    }

    .terms-content {
        padding: 12px;
    }

    .terms-content p {
        font-size: 12px;
    }

    .agree-box {
        gap: 10px;
        padding: 18px 0;
        font-size: 13px;
        margin-top: 30px;
    }

    .agree-box input {
        width: 19px;
        height: 19px;
        min-width: 19px;
    }

    .popup-buttons {
        padding: 12px;
    }

    .cancel-btn,
    .continue-btn {
        padding: 12px;
        font-size: 14px;
    }
}