/**
 * Enhanced Cart Styles for Petal Pavilion
 * Aesthetic improvements for the cart page experience
 */

/* Cart Container Styling */
.cart-wrapper {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

/* Cart Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.cart-header h1 {
    font-size: 2rem;
    color: #333;
    font-weight: 700;
    margin: 0;
}

.item-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f7f5;
    color: #3D7A67;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    font-size: 0.95rem;
}

/* Cart Container Layout */
.cart-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2.5rem;
}

/* Cart Items Section */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr 140px;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: #f9f9fc;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.cart-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.06);
}

.cart-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 5px;
    background: linear-gradient(to bottom, #3D7A67, #2c5a4c);
    border-radius: 5px 0 0 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-item:hover::after {
    opacity: 1;
}

/* Item Image */
.item-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cart-item:hover .product-thumbnail {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.product-thumbnail-placeholder {
    width: 100px;
    height: 100px;
    background-color: #f0f7f5;
    border: 1px dashed rgba(61, 122, 103, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3D7A67;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.cart-item:hover .product-thumbnail-placeholder {
    background-color: #e8f5f0;
    box-shadow: 0 5px 15px rgba(61, 122, 103, 0.1);
    transform: scale(1.05);
}

/* Item Details */
.item-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-name {
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.product-name:hover {
    color: #3D7A67;
    text-decoration: none;
}

.item-price {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
}

.item-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.cart-item:hover .quantity-control {
    border-color: #3D7A67;
    box-shadow: 0 4px 8px rgba(61, 122, 103, 0.1);
}

.quantity-btn {
    background: none;
    border: none;
    color: #3D7A67;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #f0f7f5;
}

.quantity-btn:active {
    background-color: #e8f5f0;
    transform: scale(0.95);
}

.quantity-input {
    width: 40px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    -moz-appearance: textfield;
    appearance: textfield;
    margin: 0;
    padding: 0 5px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

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

.remove-control {
    margin-left: auto;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #dc3545;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

/* Item Subtotal */
.item-subtotal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding-right: 1rem;
}

.subtotal-label {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.subtotal-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

/* Cart Summary */
.cart-summary {
    background-color: #f9f9fc;
    border-radius: 12px;
    overflow: hidden;
    height: fit-content;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 2rem;
}

.summary-header {
    padding: 1.5rem;
    background: linear-gradient(to right, #3D7A67, #2c5a4c);
    color: white;
}

.summary-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.summary-body {
    padding: 1.75rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.05rem;
}

.summary-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 1.5rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background-color: #3D7A67;
    border-color: #3D7A67;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background-color: #2c5a4c;
    border-color: #2c5a4c;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(61, 122, 103, 0.2);
}

.continue-link {
    display: block;
    text-align: center;
    color: #3D7A67;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.75rem;
    border-radius: 8px;
}

.continue-link:hover {
    background-color: #f0f7f5;
    text-decoration: none;
    color: #2c5a4c;
}

.btn-clear-cart {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    color: #dc3545;
    border-color: #dc3545;
    background-color: transparent;
    transition: all 0.2s ease;
    display: block;
    margin: 0 auto;
}

.btn-clear-cart:hover {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* Empty Cart */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1rem;
}

.empty-cart-icon {
    font-size: 5rem;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.empty-cart h3 {
    font-size: 1.75rem;
    color: #555;
    margin-bottom: 1rem;
}

.empty-cart p {
    font-size: 1.1rem;
    color: #777;
    margin-bottom: 2rem;
    max-width: 500px;
}

.btn-start-shopping {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background-color: #3D7A67;
    border-color: #3D7A67;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-start-shopping:hover {
    background-color: #2c5a4c;
    border-color: #2c5a4c;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(61, 122, 103, 0.2);
}

/* Alert Styling */
.stock-alert {
    border-left: 4px solid #ffc107;
    background-color: #fff8e1;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.5s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stock-alert.removing {
    animation: fadeOutUp 0.3s ease forwards;
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Modal Enhancements */
.modal-content {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 1.5rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    gap: 0.75rem;
}

/* Responsive Adjustments */
@media (max-width: 1199.98px) {
    .cart-container {
        grid-template-columns: 1fr 320px;
        gap: 2rem;
    }
}

@media (max-width: 991.98px) {
    .cart-wrapper {
        padding: 2rem;
    }

    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        margin-top: 2rem;
        position: static;
    }
}

@media (max-width: 767.98px) {
    .cart-wrapper {
        padding: 1.5rem;
    }

    .cart-header h1 {
        font-size: 1.75rem;
    }

    .cart-item {
        grid-template-columns: 100px 1fr;
        grid-template-rows: auto auto;
        padding: 1.25rem;
    }

    .item-image {
        grid-row: span 2;
    }

    .item-subtotal {
        grid-column: 1 / -1;
        grid-row: 3;
        align-items: flex-start;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #f0f0f0;
        padding-right: 0;
    }

    .summary-header h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 575.98px) {
    .cart-wrapper {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .cart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding-bottom: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .cart-header h1 {
        font-size: 1.5rem;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .product-thumbnail,
    .product-thumbnail-placeholder {
        width: 70px;
        height: 70px;
    }

    .item-details {
        gap: 0.5rem;
    }

    .product-name {
        font-size: 1rem;
    }

    .item-price {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .quantity-control {
        transform: scale(0.9);
        transform-origin: left;
    }

    .remove-item-btn {
        font-size: 1rem;
    }

    .subtotal-value {
        font-size: 1.1rem;
    }

    .summary-body {
        padding: 1.25rem;
    }

    .summary-line {
        font-size: 0.95rem;
    }

    .summary-total {
        font-size: 1.1rem;
    }

    .btn-checkout,
    .btn-start-shopping {
        padding: 0.85rem;
        font-size: 1rem;
    }
}