/* ==============================
   CSS Variables
============================== */
:root {
    --primary-blue: #1e88e5;
    --secondary-blue: #42a5f5;
    --light-blue: #bbdefb;
    --sky-blue: #e3f2fd;
    --dark-blue: #1565c0;
    --text-dark: #333;
    --text-light: #fff;
    --border-light: #e0e0e0;
    --success: #28a745;
    --danger: #dc3545;
    --shadow: 0 4px 12px rgba(30, 136, 229, 0.15);
    --radius: 8px;
}

/* ==============================
   Base
============================== */


/* Clean badge with blue background and yellow text */
.cart-link {
  position: relative;
  display: inline-block;
  color: #333;
  text-decoration: none;
  font-size: 28px;
  transition: transform 0.2s ease;
}

.cart-link:hover {
  transform: scale(1.1);
}

.cart-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px; /* adjusts for multi-digit numbers */
  background-color: yellow;
  color: black; 
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  animation: pop 0.5s ease forwards;
  transform-origin: center;
  will-change: transform;
}

/* Pop animation */
@keyframes pop {
  0%   { transform: scale(0); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.cart-container {
    margin: 10px auto;
    padding: 10px;
}

.cart-title {
    text-align: center;
    color: black;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

/* ==============================
   Table Wrapper
============================== */
.cart-table-wrapper {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Cart Table */
.cart-fixed-content {
    width: 100%;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

/* Table Head + Body merge */
.cart-table thead th,
.cart-table td {
    padding: 16px 12px;
}

.cart-table thead th {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--text-light);
    text-align: center;
    font-weight: 600;
    border: none;
}

.cart-table td {
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.cart-table tbody tr:last-child td {
    border-bottom: none;
}

.cart-table tbody tr:hover {
    background-color: var(--sky-blue);
}

/* ==============================
   Product Image + Link
============================== */
.cart-product-img {
    height: 80px;
    width: auto;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-link {
    color: var(--primary-blue);
    text-decoration: none;
    text-align: left;
    font-weight: 600;
    transition: color 0.3s;
}

.product-link:hover {
    color: var(--dark-blue);
    text-decoration: underline;
}

/* ==============================
   Quantity Controls
============================== */
.quantity {
    display: flex;
    align-items: center;
    justify-content: left;
}

/* merge shared button look */
.quantity button,
.remove-btn {
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.3s;
}

/* quantity button overrides */
.quantity button {
    background: var(--primary-blue);
    font-size: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity button:hover {
    background: var(--dark-blue);
}

.quantity input {
    width: 50px;
    text-align: center;
    font-size: 16px;
    padding: 6px;
    margin: 0 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--sky-blue);
}

/* ==============================
   Remove Button
============================== */
.remove-btn {
    background: var(--danger);
    padding: 8px 12px;
}

.remove-btn:hover {
    background: #c82333;
}

/* ==============================
   Total Price
============================== */
 
 
.price-container {
    text-align: center; /* Centers the inline-block element */
}

.total-price {
    font-family: 'Open Sans', Verdana, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;

    padding: 14px 22px;
    border-radius: 40px;
    border: none;

    display: inline-block;
    text-align: center;
    cursor: pointer;

    /* Gradient Background */
    background: linear-gradient(135deg, #0018F9, #0044ff);

    /* Glow + Depth */
    box-shadow:
        0 6px 18px rgba(0, 24, 249, 0.4),
        inset 0 0 6px rgba(255,255,255,0.2);

    /* Smooth animation */
    transition: all 0.3s ease;
}

/* Hover Effect */
.total-price:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 10px 25px rgba(0, 24, 249, 0.6),
        0 0 12px rgba(255, 215, 0, 0.6);
}

/* Click Effect */
.total-price:active {
    transform: scale(0.97);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

 

/* ==============================
   Action Buttons
============================== */
.cart-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 3px;     
    flex-wrap: wrap;
}

/* Shared button look */
.action-link,
.checkout-btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.continue-shopping {
    background: #fff;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: 10px 18px;   /* space around the text */
    border-radius: 6px;
    display: inline-block; /* fit width to text */
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

/* Center the button inside its container */
.button-wrapper {
    display: flex;
    justify-content: center; /* horizontal centering */
    align-items: center;     /* vertical centering, optional */
    width: 100%;
}


.continue-shopping:hover {
    background: var(--primary-blue);
    color: #fff;
    transform: translateY(-2px);
}

/* checkout button */
.checkout-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(30, 136, 229, 0.3);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(30, 136, 229, 0.4);
}

/* ==============================
   Empty Cart
============================== */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--primary-blue);
}

.empty-cart h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-cart p {
    color: #666;
    font-size: 1.1rem;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    color: var(--light-blue);
}


/* ==============================
   Desktop
============================== */
@media (min-width: 769px) {
    .cart-table-wrapper {
        overflow: visible;
    }

    .cart-table {
        min-width: 700px;
    }

    .cart-table thead th,
    .cart-table td {
        white-space: normal;
    }
    td {
        word-break: break-word;
        white-space: normal;
    }
}

/* ==============================
   Mobile Responsive
============================== */
@media (max-width: 768px) {
    .cart-container {
        padding: 10px;
    }

    .cart-table-wrapper {
        overflow-x: auto;
        overflow-y: auto;
        border-radius: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .cart-table {
        min-width: 700px;
    }

    /* merge head + td text sizing */
    .cart-table thead th,
    .cart-table td {
        padding: 12px 8px;
        font-size: 14px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    
    td {
        word-break: break-word;
        white-space: normal;
    }

    .cart-product-img {
        height: 60px;
    }

    .quantity button {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .quantity input {
        width: 40px;
        font-size: 14px;
        margin: 0 5px;
    }

    .total-price {
        font-size: 1.3rem;
        margin: 20px 0;
        padding: 12px;
    }

    .cart-actions {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .action-link {
        width: 100%;
        max-width: 300px;
    }

    .empty-cart {
        padding: 40px 15px;
    }

    .empty-cart h3 {
        font-size: 1.4rem;
    }

    .empty-cart-icon {
        font-size: 3rem;
    }
}


@media (max-width: 480px) {
    .cart-table {
        min-width: 700px;
    }

    .total-price {
        font-size: 1.2rem;
    }

    .empty-cart h3 {
        font-size: 1.3rem;
    }

    .empty-cart p {
        font-size: 1rem;
    }
    td {
        word-break: break-word;
        white-space: normal;
    }
}

