/**
 * Custom styling for WooCommerce Block-based cart
 * Based on the screenshot provided
 */

/* Main layout */
.wp-block-woocommerce-cart {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'Montserrat', Helvetica;
}

/* Custom cart title */
.cart-custom-title {
    text-transform: uppercase;
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    height: 0;
}

.is-large.wc-block-cart .wc-block-cart-items{
    border-bottom: none !important;
}

/* Back button */
.cart-back-button {
    display: inline-flex;
    align-items: center;
    color: #909091;
    text-decoration: none;
    margin-bottom: 30px;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    top: -7px;
}
.cart-back-button:hover {
    color: #000;
}

.cart-back-button:before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border-left: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: rotate(45deg);
    margin-right: 10px;
}

/* Cart notification message */
.cart-notification-message {
    background: #CAF8E8;
    color: #000;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
}

.cart-notification-message p {
    margin: 0;
    font-size: 12px;
}

.cart-notification-message p span {
    font-weight: 700;
}

/* Cart page header */
.wp-block-woocommerce-cart .wp-block-woocommerce-cart-i2 {
    margin-bottom: 20px;
}

/* Cart table column headers */
.wc-block-components-order-summary-item__header {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.wc-block-cart__header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.wc-block-cart__header-product, 
.wc-block-cart__header-total {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
}

/* Product listing */
.wc-block-cart-items,
.wp-block-woocommerce-cart-line-items-block {
    padding: 22px 27px;
}

.wc-block-cart-item__image {
    width: 155px;
    margin-right: 15px !important;
} 

.wc-block-cart-item__image img {
    width: 100%;
}

.wc-block-components-sidebar, .wp-block-woocommerce-cart-items-block{
    width: 50% !important;
}
.wc-block-cart__submit-container {
    display: flex;
    justify-content: end;
}
.wc-block-cart__submit-button {
    width: 260px !important;
}

.wc-block-components-sidebar {
    background-color: #fff;
}

.wc-block-cart-item__prices {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 100px;
}

/* Create a container for quantity and price */
.wc-block-cart-item__quantity-price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    width: 100%;
    gap: 20px;
}

/* Adjust quantity section when in the container */
.wc-block-cart-item__quantity-price-container .wc-block-cart-item__quantity {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* Adjust prices when in the container */
.wc-block-cart-item__quantity-price-container .wc-block-cart-item__prices {
    flex: 0 0 auto;
    margin-top: 0;
}

.wc-block-cart-item__remove-link {
    font-size: 40px !important;
    color: #000 !important;
    text-decoration: none !important;
}

/* Quantity selector */
.wc-block-components-quantity-selector {
    border: 1px solid #ddd;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 0px !important;
    width: 100px;
    height: 32px;
}

.wc-block-components-quantity-selector__button {
    color: #333;
    padding: 0 8px;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
}

.wc-block-components-quantity-selector__input {
    width: 30px;
    text-align: center;
    font-size: 14px;
    border: none;
    margin: 0;
    padding: 0;
}

/* Quantity label */
.quantity-label {
    display: inline-block;
    font-weight: 500;
    font-size: 12px;
    color: #757575;
}

/* Cart totals */
.wc-block-cart__sidebar {
    width: 350px;
}

.wp-block-woocommerce-cart-order-summary-shipping-block.wc-block-components-totals-wrapper{
    padding: 0 !important;
}

.wc-block-components-totals-item {
    padding: 0 !important;
}

/* Match totals item labels and values */
.wc-block-components-totals-item__label {
    font-weight: normal;
    font-size: 16px !important;
}

.wc-block-components-totals-item__value {
    font-weight: 500;
    text-align: right;
    font-size: 16px;
}

/* Also target any additional classes that might be used for totals */
.wc-block-components-totals-shipping__value,
.wc-block-components-totals-discount__value,
.wc-block-components-totals-subtotal__value {
    font-size: 16px;
    font-weight: 500;
    text-align: right;
}

/* Footer items (total) */
.wc-block-components-totals-footer-item {
    font-weight: 700;
    font-size: 18px;
}

.wc-block-components-totals-footer-item-tax,
.wc-block-components-totals-footer-item-tax-value {
    font-size: 18px !important;
    font-weight: 700;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 18px !important;
    font-weight: 700; 
    color: #000 !important;
}

.wc-block-components-sidebar {
    padding-right: 2.2641509434%;
}

.wc-block-components-totals-item:last-child {
    border-bottom: none;
}

/* Coupon section */
.wc-block-components-coupon-form {
    background-color: #f7f7f7;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}
 
.wc-block-components-totals-coupon__summary-heading {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 500;
}

.wc-block-components-totals-coupon-fields {
    display: flex;
}

.wc-block-components-text-input {
    flex: 1;
}

.wc-block-components-text-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.wc-block-components-button {
    background-color: #17b8ce !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 0 4px 4px 0 !important;
    cursor: pointer !important;
}

.wc-block-cart__submit-button {
    background-color: #00D6C7 !important;
    color: #000 !important;
    display: block;
    width: 100%;
    padding: 15px !important;
    text-align: center;
    border-radius: 4px !important;
    text-decoration: none;
    font-weight: 500 !important;
    text-transform: none !important;
    font-size: 16px;
}

/* Shipping options */
.wc-block-components-shipping-rates-control__package {
    background-color: #f7f7f7;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.wc-block-components-shipping-rates-control__package-title {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 500;
}

.wc-block-components-radio-control__option {
    padding: 10px 0;
}

.wc-block-components-radio-control__label {
    font-weight: 500;
}

.wp-block-woocommerce-cart .wc-block-components-totals-coupon {
    display: none;
}

/* Notification message */
.wc-block-components-notice-banner {
    background-color: #f7f7f7;
    border-left: 3px solid #ffab00;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.wc-block-components-notice-banner__content {
    margin: 0;
    font-size: 14px;
}

.wc-block-components-notice-banner__icon {
    margin-right: 10px;
}

.wc-block-cart-item__product {
    width: 100%;
}

/* Mobile styles */
@media (max-width: 1080px) {
    .wc-block-components-sidebar, .wp-block-woocommerce-cart-items-block {
        width: 100% !important;
    }
    .wc-block-cart-items, .wp-block-woocommerce-cart-line-items-block {
        padding: 0 !important;
    }
    .wp-block-woocommerce-cart {
        display: flex;
        flex-direction: column;
    }
    
    .wc-block-cart__sidebar {
        width: 100% !important;
        margin-top: 30px;
    }
    
    .wc-block-cart-item__product {
        flex-wrap: wrap;
    }
    
    /* .wc-block-cart-item__quantity-price-container {
        flex-direction: column;
        align-items: flex-start;
    } */
    .wc-block-cart-item__quantity-price-container {
        display: block;
    }
    
    .wc-block-cart-item__prices {
        margin-top: 10px;
    }
    .cart-custom-title {
        font-size: 20px ;
    }
    .cart-back-button {
        color: transparent;
        top: -10px;
    }
    .wc-block-cart__submit-button {
        width: 100% !important;
    }
    .wp-block-woocommerce-cart {
        padding: 0;
    }
    .container {
        padding: 0;
    }
    .cart-custom-title, .cart-back-button {
        padding: 0 20px;
    }
    .wc-block-cart-items {
        padding: 20px !important;
    }
    .wc-block-cart-items__row {
        display: flex;
        justify-content: space-between;
    }
    .wc-block-cart-item__quantity {
        display: flex;
        flex-direction: column;
    }
    .wc-block-cart-item__quantity-price-container .wc-block-cart-item__quantity{
        align-items: baseline;
    }
    .wc-block-cart-item__image img {
        width: 100px !important;
        margin-right: 0;
    }
    .wc-block-cart-item__wrap {
        padding-left: 5px;
    }
    table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__wrap>* {
        margin-bottom: 5px !important;
    }
    .is-mobile table.wc-block-cart-items .wc-block-cart-items__row {
        display: flex;
        align-items: normal;
    }
    .wc-block-cart-item__prices {
        position: absolute;
        bottom: 5px;
        right: 0;
    }
    .wc-block-cart-item__image {
        width: 120px !important;
        margin-right: 0px !important;
    }
    .is-mobile table.wc-block-cart-items .wc-block-cart-items__row {
        grid-template-columns: 40px 132px !important;
    }
    .wc-block-components-sidebar {
        margin-top: 17px !important;
    }
    .wc-block-components-sidebar.wc-block-cart__sidebar.wp-block-woocommerce-cart-totals-block, .custom-coupon-container{
        padding: 0 20px !important;
    }
    .wc-block-components-totals-item__label {
        font-weight: 600;
        color: #000;
    }
}

/* Main product-total layout */
.wc-block-cart-items__header {
    display: none !important;
}

.wc-block-cart-items__header-product {
    flex: 1;
    text-transform: uppercase;
    font-weight: 600;
}

.wc-block-cart-items__header-total {
    width: 100px;
    text-align: right;
    text-transform: uppercase;
    font-weight: 600;
}

.wc-block-cart-items__row {
    display: flex;
    align-items: center;
    position: relative;
}

.wc-block-components-product-metadata {
    margin-bottom: 8px;
}

.wc-block-components-product-metadata__description,
.wc-block-components-product-metadata__variation-data {
    font-size: 12px;
    color: #555;
    display: flex;
    align-items: center;
    line-height: 1.5;
}

/* Color swatch label */
.wc-block-components-product-metadata__variation-data strong,
.wc-block-components-product-metadata__description strong {
    color: #757575;
    font-weight: 500;
    margin-right: 5px;
    font-size: 12px;
}

/* Price styling */
.wc-block-cart-item__total {
    display: none !important;
}

/* Remove link styling */
.wc-block-cart-item__remove-link.remove-icon {
    position: absolute;
    top: -10px;
    right: 0;
    font-size: 20px;
    text-decoration: none;
    color: #999;
    font-weight: bold;
    width: 25px;
    height: 25px;
    line-height: 23px;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: inline-block;
}

.wc-block-cart-item__remove-link.remove-icon:hover {
    color: #ff0000;
    border-color: #ff0000;
}

/* Add coupon section */
.wc-block-components-totals-coupon-link {
    display: block;
    margin-bottom: 10px;
    color: #17b8ce;
    text-decoration: none;
    font-weight: 500;
}

/* Moved coupon panel styling */
.wc-block-components-totals-coupon.wc-block-components-panel {
    border: none !important;
    background: transparent !important;
}

/* Custom shipping section */
.custom-shipping-section {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.shipping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shipping-title {
    font-weight: 600;
    font-size: 16px;
    color: #000;
}

.shipping-company {
    color: #909091;
    font-size: 16px;
    font-weight: normal;
}

.shipping-info {
    padding-top: 20px !important;
    font-size: 14px;
    color: #909091;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 5px;
    font-weight: normal;
    width: 331px;
}

/* Match exactly the layout from screenshot */
.wc-block-cart__totals-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.wc-block-components-totals-item__label:after {
    content: ":";
}

/* Fix for shipping selector */
.wc-block-components-shipping-calculator-address__button.wc-block-components-button {
    border-radius: 4px !important;
    margin-top: 10px;
}

/* Ensure page title is hidden */
.woocommerce-products-header__title {
    display: none !important;
}

/* Hide standard page title */
.entry-title:not(.cart-custom-title) {
    display: none !important;
}


/* Override any default margins that might interfere with our layout */
body.woocommerce-cart .woocommerce {
    margin: 0 !important;
}

/* Add extra space to make sure our cart notification is visible */
.cart-notification-message {
    margin-top: 0 !important;
}

/* Two column layout for desktop */
@media (min-width: 769px) {
    .wp-block-woocommerce-cart-items-block, 
    .wp-block-woocommerce-cart-totals-block {
        display: inline-block;
        vertical-align: top;
    }
    
    .wp-block-woocommerce-cart-items-block {
        width: calc(100% - 380px);
        margin-right: 30px;
        float: left;
    }
    
    .wp-block-woocommerce-cart-totals-block {
        width: 350px;
        float: right;
    }
    
    /* Make sure the container is cleared after the floating elements */
    .wp-block-woocommerce-cart:after {
        content: "";
        display: table;
        clear: both;
    }
}

/* Add spacing to first cart item */
.wc-block-cart-items__row:first-child {
    padding-top: 0;
}

/* Custom Coupon Container */
.custom-coupon-container {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.custom-coupon-title {
    font-size: 14px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    color: #000;
}

.custom-coupon-form {
    display: flex;
    align-items: center;
}

.custom-coupon-input {
    flex: 1;
    height: 52px;
    padding: 0 12px;
    border: 1px solid #000 !important;
    border-radius: 4px 0 0 4px;
    margin-right: 11px;
    font-size: 14px;
    box-shadow: none;
    outline: none;
    width: 227px;
}

.custom-coupon-input:focus {
    border-color: #00D6C7;
    outline: none;
}

.custom-coupon-button {
    width: 160px;
    background-color: #00D6C7 !important;
    color: #000 !important;
    border: none !important;
    padding: 0 20px !important;
    height: 52px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    text-transform: none !important;
    min-height: unset !important;
    line-height: 52px !important;
}

/* Make sure WooCommerce applied coupon styles work with our custom UI */
.wc-block-components-notice-banner.is-success {
    margin-bottom: 15px;
}

/* Hide the default panel toggle button */
.wc-block-components-totals-coupon .wc-block-components-panel__button {
    display: none !important;
}

/* Hide the original coupon content without removing its functionality */
.original-coupon-content {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide cart totals heading */
.wp-block-woocommerce-cart-order-summary-heading-block,
.wc-block-cart__totals-title {
    display: none !important;
}

/* Product names - comprehensive styling */
.wc-block-cart-item__product-name,
.wc-block-components-product-name,
.wc-block-components-product-name a,
a.wc-block-components-product-name,
.wc-block-grid__product-title,
.wc-block-components-product-title,
.woocommerce-loop-product__title {
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #000 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.4 !important;
}

/* Price components - comprehensive styling */
.wc-block-components-product-price, .wc-block-components-product-price del, .wc-block-components-product-price ins {
    width: 100%;
}

.wc-block-components-product-price,
.wc-block-components-product-price__value,
.wc-block-formatted-money-amount,
.wc-block-components-formatted-money-amount,
.wc-block-cart-item__prices,
.wc-block-components-product-price__value.is-discounted {
    color: #000 !important;
    font-size: 14px !important;
    background: none !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.wc-block-components-totals-footer-item-tax-value{
    font-size: 18px !important;
}

.wc-block-components-product-price__regular {
    color: #B4B4B5 !important;
    font-size: 14px !important;
    background: none !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.wc-block-components-product-name {
    margin-bottom: 0 !important;
}

/* Sale price/original price styling */
.wc-block-components-product-price--regular,
del .wc-block-formatted-money-amount,
del .wc-block-components-formatted-money-amount {
    font-size: 14px !important;
    text-decoration: line-through !important;
    color: #757575 !important;
    margin-bottom: 2px !important;
    display: block !important;
    background: none !important;
    font-weight: normal !important;
}

/* Hide all sale badges completely */
.wc-block-components-product-badge.wc-block-components-sale-badge,
.wc-block-components-sale-badge,
.wc-block-grid__product-onsale,
span.onsale {
    display: none !important;
}

/* Coupon panel after sidebar */
.wp-block-woocommerce-cart-totals-block + .wc-block-components-totals-coupon.wc-block-components-panel,
.wc-block-cart__sidebar + .wc-block-components-totals-coupon.wc-block-components-panel,
.wc-block-components-sidebar + .wc-block-components-totals-coupon.wc-block-components-panel {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    float: right;
    clear: right;
}

/* Adjust coupon container when it's after sidebar */
.wp-block-woocommerce-cart-totals-block + .wc-block-components-totals-coupon .custom-coupon-container,
.wc-block-cart__sidebar + .wc-block-components-totals-coupon .custom-coupon-container,
.wc-block-components-sidebar + .wc-block-components-totals-coupon .custom-coupon-container {
    padding: 0;
    background-color: transparent;
    margin: 0;
}

/* Ensure responsive layout for coupon panel after sidebar */
@media (max-width: 768px) {
    .wp-block-woocommerce-cart-totals-block + .wc-block-components-totals-coupon.wc-block-components-panel,
    .wc-block-cart__sidebar + .wc-block-components-totals-coupon.wc-block-components-panel,
    .wc-block-components-sidebar + .wc-block-components-totals-coupon.wc-block-components-panel {
        width: 100%;
        float: none;
        clear: both;
    }
}

/* Cart items bottom margin to account for coupon placement */
.wp-block-woocommerce-cart-line-items-block {
    margin-bottom: 50px;
}

/* Additional product name selectors */
.wc-block-grid__product-title,
.wc-block-components-product-title,
.woocommerce-loop-product__title {
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #000 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Discounted price value styling */
.wc-block-components-product-price__value.is-discounted {
    color: #46C18F !important;
    font-size: 14px !important;
    background: none !important;
    font-weight: 700;
}

/* Override WooCommerce Block Cart empty text */
.wc-block-cart__empty-cart__title {
    font-size: 0 !important;
    visibility: hidden;
}

.wc-block-cart__empty-cart__title::after {
    content: "Вашата количка е празна!" !important;
    font-size: 24px;
    visibility: visible;
    display: block;
}

/* Override "New in store" text */
.wp-block-heading.has-text-align-center:not(.wc-block-cart__empty-cart__title) {
    font-size: 0 !important;
    visibility: hidden;
}

.wp-block-heading.has-text-align-center:not(.wc-block-cart__empty-cart__title)::after {
    content: "Ново" !important;
    font-size: 24px;
    visibility: visible;
    display: block;
} 