/* 
 * ZAPBOOTS - Premium Footwear Store
 * Cart Page Stylesheet
 */

/* Import base variables and styles */
@import url('styles.css');

/* ===== CART HERO ===== */
.cart-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cart-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/pattern-bg.svg');
    background-repeat: repeat;
    opacity: 0.1;
    z-index: 1;
}

.cart-hero .container {
    position: relative;
    z-index: 2;
}

.cart-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: fadeIn 1s ease;
}

.cart-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
    animation: fadeIn 1.2s ease;
}

/* ===== CART ITEMS SECTION ===== */
.cart-items-section {
    padding: 80px 0;
    background-color: var(--light-color);
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 767px) {
    .cart-items-section {
        padding: 40px 0;
    }
    
    .cart-hero h1 {
        font-size: 1.4rem;
        white-space: normal;
        overflow: visible;
    }
    
    .empty-cart h2 {
        font-size: 1.2rem;
        white-space: normal;
        overflow: visible;
    }
    
    .related-products h2 {
        font-size: 1.2rem;
        white-space: normal;
        overflow: visible;
    }
    
    .item-details h3 {
        font-size: 0.9rem;
        white-space: normal;
        overflow: visible;
    }
    
    .cart-summary h2 {
        font-size: 1.1rem;
        white-space: normal;
        overflow: visible;
    }
    
    .cart-summary h3 {
        font-size: 1rem;
        white-space: normal;
        overflow: visible;
    }
}

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Cart List */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.cart-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.cart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.cart-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.cart-item:hover img {
    transform: scale(1.05);
}

.item-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.item-details p {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.quantity-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quantity-minus, .quantity-plus {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background-color: var(--gray-200);
    color: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quantity-minus:hover, .quantity-plus:hover {
    background-color: var(--primary-color);
    color: white;
}

.quantity-value {
    font-weight: 600;
    color: var(--gray-800);
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
}

.remove-form {
    align-self: center;
}

.remove-item {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--gray-200);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.remove-item:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: rotate(90deg);
}

/* Cart Summary */
.cart-summary {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 2rem;
}

.cart-summary h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.cart-summary p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--gray-700);
    font-size: 1rem;
}

.cart-summary h3 {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-200);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.cart-summary span {
    font-weight: 600;
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--body-font);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.checkout-btn::before {
    content: '\f07a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.clear-cart-form {
    margin-top: 1rem;
}

.clear-cart-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--gray-200);
    color: var(--gray-700);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.clear-cart-btn:hover {
    background-color: var(--gray-300);
    color: var(--gray-900);
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 3rem;
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.empty-cart i {
    font-size: 4rem;
    color: var(--gray-400);
    margin-bottom: 1.5rem;
}

.empty-cart h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.empty-cart p {
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.continue-shopping-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.continue-shopping-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

.continue-shopping {
    margin-top: 1.5rem;
    text-align: center;
}

.continue-shopping a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.continue-shopping a:hover {
    color: var(--secondary-color);
    transform: translateX(-5px);
}

/* ===== RELATED PRODUCTS ===== */
.related-products {
    padding: 60px 0;
    background-color: var(--gray-100);
}

.related-products h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 1rem;
}

.related-products h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

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

.product-card {
    width: 30%;
    position: relative;
    background-color: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.product-badge.new {
    background-color: var(--accent-color);
    color: var(--dark-color);
}

.product-badge.sale {
    background-color: var(--secondary-color);
    color: white;
}

.product-img {
    position: relative;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform var(--transition-normal);
    margin: 0 auto;
    display: block;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    transition: bottom var(--transition-normal);
}

.product-card:hover .product-actions {
    bottom: 0;
}

.add-to-cart-form {
    display: contents;
}

.action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn.add-to-cart {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn.add-to-cart:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-category {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 0.8rem;
}

.product-price {
    margin-bottom: 0.8rem;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    font-size: 0.9rem;
    color: var(--gray-600);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.product-rating {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.product-rating i {
    color: var(--accent-color);
    margin-right: 2px;
}

.product-rating span {
    margin-left: 5px;
    color: var(--gray-600);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Cart Tabs */
.mobile-cart-tabs {
    display: none;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.mobile-cart-tabs .tab-btn {
    flex: 1;
    padding: 1rem;
    background-color: var(--gray-200);
    color: var(--gray-700);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-cart-tabs .tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: block;
}

/* Responsive styles */
@media (max-width: 991px) {
    .cart-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .mobile-cart-tabs {
        display: flex;
    }
    
    .tab-content {
        display: none;
    }
    
    .tab-content.active {
        display: block;
    }
    
    .cart-summary {
        position: static;
        top: auto;
    }
    
    .cart-hero h1 {
        font-size: 2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .empty-cart h2 {
        font-size: 1.4rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .related-products h2 {
        font-size: 1.6rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .item-details h3 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .cart-summary h2 {
        font-size: 1.6rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .cart-summary h3 {
        font-size: 1.4rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 767px) {
    .cart-item {
        grid-template-columns: 100px 1fr auto;
        gap: 1rem;
        padding: 1rem;
    }
    
    .item-details h3 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .item-details p {
        font-size: 0.9rem;
    }
    
    .quantity-controls {
        margin-top: 0.5rem;
    }
    
    .cart-hero h1 {
        font-size: 1.2rem;
        white-space: normal;
        overflow: visible;
    }
    
    .empty-cart h2 {
        font-size: 1rem;
        white-space: normal;
        overflow: visible;
    }
    
    .cart-summary h2 {
        font-size: 1rem;
        white-space: normal;
        overflow: visible;
    }
    
    .cart-summary h3 {
        font-size: 0.9rem;
        white-space: normal;
        overflow: visible;
    }
    
    .related-products h2 {
        font-size: 1.1rem;
        white-space: normal;
        overflow: visible;
    }
}

@media (max-width: 576px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-areas:
            "image details"
            "image controls";
        gap: 0.75rem;
        padding: 0.75rem;
        overflow-x: hidden;
    }
    
    .cart-item img {
        grid-area: image;
        height: 100px;
        width: 80px;
        object-fit: contain;
    }
    
    .item-details {
        grid-area: details;
        padding-right: 30px; /* Make space for remove button */
    }
    
    .quantity-controls {
        grid-area: controls;
        margin-top: 0;
    }
    
    .remove-form {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .quantity-form {
        gap: 0.5rem;
    }
    
    .quantity-minus, .quantity-plus {
        width: 26px;
        height: 26px;
    }
    
    .quantity-value {
        width: 30px;
    }
    
    .cart-hero h1 {
        font-size: 1rem;
        white-space: normal;
        overflow: visible;
    }
    
    .empty-cart h2 {
        font-size: 0.9rem;
        white-space: normal;
        overflow: visible;
    }
    
    .related-products h2 {
        font-size: 0.95rem;
        white-space: normal;
        overflow: visible;
    }
    
    .item-details h3 {
        font-size: 0.75rem;
        white-space: normal;
        overflow: visible;
    }
    
    .cart-summary h2 {
        font-size: 0.9rem;
        white-space: normal;
        overflow: visible;
    }
    
    .cart-summary h3 {
        font-size: 0.8rem;
        white-space: normal;
        overflow: visible;
    }
}