/* ==========================================================================
   Shady Corner Custom Cart Page Styles
   ========================================================================== */

/* --- Main Layout & Structure --- */
/* --- FIX: Apply flex to the .woocommerce container directly --- */
.woocommerce-cart .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.woocommerce-cart .woocommerce-cart-form {
    flex: 2;
    min-width: 60%;
}

.woocommerce-cart .cart-collaterals {
    flex: 1;
    min-width: 300px;
    position: sticky;
    top: 40px; /* Adjust as needed for your header height */
}

/* --- FIX: Alert & Notice Styling --- */
/* --- This ensures that if a notice (or its wrapper) becomes a flex item, it takes the full width. --- */
.woocommerce-cart .woocommerce-notices-wrapper,
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-error {
    flex-basis: 100%;
    width: 100%;
    box-sizing: border-box;
}


/* --- Glassmorphic Panels --- */
/* --- FIX: Restore the background to the main form element --- */
.woocommerce-cart .woocommerce-cart-form,
.cart-collaterals .cart_totals,
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-error {
    background: rgba(35, 29, 51, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: white; /* Ensure text is readable */
}

.woocommerce .woocommerce-message a.button,
.woocommerce .woocommerce-info a.button {
    background-color: #70399b !important; /* Style "View Cart" etc. buttons */
}
.woocommerce .woocommerce-message a.button:hover,
.woocommerce .woocommerce-info a.button:hover {
     background: linear-gradient( to bottom, #8343b8 5%, #612f8a 95%) !important;
}


/* --- Cart Table Styling --- */
.woocommerce table.shop_table {
    border: none;
    border-radius: 8px;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: transparent;
}

.woocommerce-error::before, .woocommerce-info::before, .woocommerce-message::before {
    display: none;
}

.woocommerce table.shop_table thead {
    display: table-header-group;
    background: rgba(255, 255, 255, 0.05);
}

.woocommerce table.shop_table th {
    border: none;
    padding: 15px 20px;
    color: #fff;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.woocommerce table.shop_table tbody tr {
    background: transparent;
}

.woocommerce table.shop_table tbody td {
    padding: 20px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #c7d5e0;
    vertical-align: middle;
}

.woocommerce table.shop_table tr:last-child td {
    border-bottom: none;
}

/* Product Info in Table */
.woocommerce table.shop_table td.product-thumbnail img {
    width: 70px;
    height: auto;
    border-radius: 5px;
}

.woocommerce table.shop_table td.product-name a {
    color: #fff;
    font-weight: bold;
    transition: color 0.2s ease;
}

.woocommerce table.shop_table td.product-name a:hover {
    color: #ff38a2;
}

.woocommerce table.shop_table td.product-remove .remove {
    color: #ff4646 !important;
    font-size: 2em;
    text-decoration: none;
    transition: all 0.2s ease;
}

.woocommerce table.shop_table td.product-remove .remove:hover {
    background-color: transparent !important;
    color: #fff !important;
    transform: scale(1.1);
}

/* --- Quantity Input --- */
.woocommerce .quantity .input-text.qty {
    background-color: #231d33;
    border: 1px solid #70399b;
    color: white;
    padding: 8px;
    border-radius: 5px;
    width: 60px;
    text-align: center;
}

/* --- Coupon & Actions --- */
.woocommerce table.shop_table td.actions {
    padding: 20px;
}

.woocommerce .coupon {
    display: flex;
    gap: 10px;
    align-items: center;
}

.woocommerce .coupon label {
    display: none;
}

.woocommerce .coupon #coupon_code {
    background-color: #231d33;
    border: 1px solid #70399b;
    color: white;
    padding: 12px;
    border-radius: 5px;
    flex-grow: 1;
}

/* --- Buttons --- */
.woocommerce .button,
.woocommerce button.button,
.woocommerce #respond input#submit {
    background: linear-gradient( to bottom, #799905 5%, #53690c 95%) !important;
    color: white !important;
    padding: 12px 20px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    border: none !important;
    transition: transform 0.2s ease, background 0.2s ease !important;
    line-height: 1.2 !important;
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce #respond input#submit:hover {
    background: linear-gradient( to bottom, #88ab06 5%, #637b0e 95%) !important;
    transform: scale(1.05);
}

.woocommerce .wc-proceed-to-checkout .button {
     background: linear-gradient( to bottom, #70399b 5%, #512672 95%) !important;
}

.woocommerce .wc-proceed-to-checkout .button:hover {
     background: linear-gradient( to bottom, #8343b8 5%, #612f8a 95%) !important;
}

/* --- Cart Totals Section --- */

.woocommerce .cart_totals h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #fff;
}

.woocommerce .cart_totals table.shop_table {
    background: none;
    width: 100%;
}

.woocommerce .cart_totals table.shop_table th,
.woocommerce .cart_totals table.shop_table td {
    border: none;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.woocommerce #content table.cart td.actions .input-text, .woocommerce table.cart td.actions .input-text, .woocommerce-page #content table.cart td.actions .input-text, .woocommerce-page table.cart td.actions .input-text {
    width: auto;
}

.woocommerce .cart_totals table.shop_table tr:last-child th,
.woocommerce .cart_totals table.shop_table tr:last-child td {
    border-bottom: none;
}

.woocommerce .cart-collaterals .cart_totals, .woocommerce-page .cart-collaterals .cart_totals {
    float: none; /* FIX: Remove float for flexbox */
    width: auto; /* FIX: Let flexbox control the width */
}

.woocommerce .cart_totals .wc-proceed-to-checkout a.checkout-button {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 1.1em;
}

/* --- FIX: Select Dropdown Styling --- */
.woocommerce .cart-collaterals select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px 16px;
    background-color: rgba(15, 12, 25, 0.7);
    border: 1px solid rgba(112, 57, 155, 0.8);
    color: white;
    padding: 12px 40px 12px 15px;
    border-radius: 5px;
}

.select2-container--default .select2-selection--single {
    background: rgba(15, 12, 25, 0.7) !important;
    border: 1px solid rgba(112, 57, 155, 0.8) !important;
    border-radius: 5px !important;
    height: 48px !important;
    padding: 8px 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: white !important;
    line-height: 32px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #fff transparent transparent transparent !important;
}
.select2-dropdown {
     background-color: #231d33 !important;
     border: 1px solid #70399b !important;
     backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #70399b !important;
}


/* --- Empty Cart & Alerts --- */
.woocommerce-cart .cart-empty.woocommerce-info {
    flex-basis: 100%;
    text-align: center;
}

.woocommerce .woocommerce-message a, 
.woocommerce .woocommerce-info a {
    color: #f0a9ff;
    font-weight: bold;
}

.woocommerce .woocommerce-message::before, 
.woocommerce .woocommerce-info::before {
    color: #ff38a2;
}

.woocommerce-cart a.button.wc-backward {
    margin-top: 20px;
}

