/**
 * Routine Wellness Addons Cart - Styles
 * Version: 0.1
 */

.routinecos-cart-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.routinecos-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.routinecos-cart-container.is-open .routinecos-cart-overlay {
    opacity: 1;
    pointer-events: auto;
}

.routinecos-cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 550px;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
}

.routinecos-cart-container .routinecos-shipping-method-list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.routinecos-cart-container .routinecos-shipping-method-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.routinecos-cart-container .routinecos-shipping-method-list li:last-child {
    margin-bottom: 0;
}

.routinecos-cart-container .routinecos-shipping-method-list input[type="radio"] {
    flex-shrink: 0;
    margin: 0;
}

.routinecos-cart-container .routinecos-shipping-method-list label {
    margin: 0!important;
    display: inline;
}

/* Shipping tooltip icon */
.routinecos-shipping-tooltip {
    font-style: normal;
    cursor: pointer;
    color: #666;
    margin-left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.routinecos-shipping-tooltip:hover {
    color: #333;
}

.routinecos-shipping-tooltip .fa-info-circle {
    font-size: 14px;
}

/* Mobile touch target improvement for shipping tooltip */
@media (max-width: 767px) {
    .routinecos-shipping-tooltip {
        min-width: 32px;
        min-height: 32px;
        margin-left: 0;
    }
    
    .routinecos-shipping-tooltip .fa-info-circle {
        font-size: 16px;
    }
}

/* Ensure Bootstrap tooltips appear above the cart panel */
.tooltip {
    z-index: 99999 !important;
}

.routinecos-cart-container.is-open .routinecos-cart-panel {
    transform: translateX(0);
}

.routinecos-cart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.routinecos-cart-header-left {
    flex: 1;
}

.routinecos-cart-header h3 {
    margin: 0;
    font-size: 30px!important;
    font-weight: 600;
    text-transform: none!important;
}

.routinecos-free-shipping-message {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #7d7d7d;
}

.routinecos-cart-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: color 0.2s ease;
}

.routinecos-cart-close:hover {
    color: #000;
}

.routinecos-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Notices Section */
.routinecos-cart-notices {
    margin-bottom: 15px;
    animation: slideInDown 0.3s ease-out;
    transition: opacity 0.3s ease-out;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    padding-bottom: 10px;
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -20px;
    padding: 20px 20px 10px 20px;
}

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

.routinecos-cart-notice {
    padding: 12px 40px 12px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.routinecos-notice-content {
    display: block;
}

.routinecos-notice-dismiss {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: currentColor;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.routinecos-notice-dismiss:hover {
    opacity: 1;
}

.routinecos-notice-dismiss svg {
    width: 16px;
    height: 16px;
}

.routinecos-cart-notice a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

.routinecos-cart-notice a:hover {
    text-decoration: none;
}

.routinecos-cart-notice-success {
    background: #f0f9f4;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.routinecos-cart-notice-error {
    background: #fef4f4;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.routinecos-cart-notice-info {
    background: #f0f7ff;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

.routinecos-cart-notice-notice {
    background: #fff8e1;
    border-left: 4px solid #ffa000;
    color: #f57c00;
}

/* Free gift message styling */
.routinecos-cart-notice .sp-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.routinecos-cart-notice .sp-inner svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.routinecos-cart-notice .sp-inner > div {
    flex: 1;
}

.routinecos-cart-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.routinecos-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.routinecos-cart-items {
}

.routinecos-cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.routinecos-cart-item:last-child {
    border-bottom: none;
}

.routinecos-cart-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.routinecos-cart-item-image img {
    width: auto;
    max-height: 80px!important;
    object-fit: cover;
}

.routinecos-cart-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.routinecos-cart-item-details .routinecos-cart-item-quantity,
.routinecos-cart-item-details .routinecos-cart-item-price {
    display: inline-block;
}

.routinecos-cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.routinecos-cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.routinecos-cart-item-title a {
    color: #7d7d7d;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
}

.routinecos-cart-item-title a:hover {
    color: #000;
}

.routinecos-cart-item-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.routinecos-cart-item-quantity {
    font-size: 13px;
    color: #666;
}

/* Quantity selector with minus/plus buttons */
.routinecos-quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.routinecos-qty-btn {
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 16px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    padding: 0;
    line-height: 1;
    margin: 0;
}

.routinecos-qty-btn:hover {
    background: #e0e0e0;
}

.routinecos-qty-btn:active {
    background: #d0d0d0;
}

.routinecos-qty-value {
    min-width: 30px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    padding: 0 5px;
}

/* Item price display */
.routinecos-cart-item-price {
    font-size: 14px;
    font-weight: 800;
    color: #7d7d7d;
    text-align: right;
    min-width: 70px;
}

.routinecos-cart-item-price .woocommerce-Price-amount {
    color: #7d7d7d;
    font-weight: 800;
}

.routinecos-cart-item-price .routinecos-original-price {
    color: #999;
    font-size: 12px;
    display: block;
}

.routinecos-cart-item-price .routinecos-discounted-price {
    color: #ef4036;
    text-decoration: none;
    display: block;
}

.routinecos-item-quantity {
    margin-right: 5px;
}

.routinecos-item-prices {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.routinecos-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 13px;
}

.routinecos-discounted-price {
    color: #ef4036;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}

/* Free item styling */
.routinecos-free-item {
    flex-direction: row;
    gap: 6px;
}

/* Red strikethrough for original prices when discounted (free gifts or coupon applied) */
.routinecos-item-prices .routinecos-original-price {
    text-decoration-color: #ef4036;
}

.routinecos-free-label {
    color: #ef4036;
    font-weight: 600;
    font-size: 14px;
}

.routinecos-cart-item-row.is-free-gift {
    justify-content: flex-end;
}

/* Subscription price with frequency */
.routinecos-subscription-prices {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.routinecos-subscription-price {
    font-weight: 800;
    font-size: 14px;
    color: #7d7d7d;
}

.routinecos-subscription-frequency {
    font-size: 11px;
    color: #666;
    font-weight: 400;
}

/* Free gift scent selector */
.routinecos-scent-selector-wrapper {
    margin: 8px 0;
}

.routinecos-scent-dropdown {
    width: 100%;
    padding: 10px 14px;
    padding-right: 25px;
    border: 1px solid #d2d4d6;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNiIgaGVpZ2h0PSIxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0tNy01aDIwdjIwSC03eiIvPjxwYXRoIGQ9Ik02IDNIMGwzLTMgMyAzem0tLjEgNEwzIDkuOS4xIDdoNS44eiIgZmlsbD0iIzlDQTBBNiIvPjwvZz48L3N2Zz4=');
    background-position: calc(100% - 15px) 50%;
    background-repeat: no-repeat;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: opacity 0.2s ease;
}

.routinecos-scent-dropdown:focus {
    outline: none;
    border-color: #999;
}

.routinecos-scent-dropdown:hover {
    border-color: #999;
}

.routinecos-cart-item-remove {
    flex-shrink: 0;
}

.routinecos-cart-item-remove a.remove {
    color: #999;
    text-decoration: none;
    font-size: 26px!important;
    line-height: 1;
    display: block;
    width: 35px;
    height: 35px;
    text-align: center;
}

.routinecos-cart-item-remove a:hover {
    color: #c00;
}

.routinecos-cart-footer {
    border-top: 1px solid #e0e0e0;
    padding: 20px;
    background: #fff;
    flex-shrink: 0;
}

.routinecos-cart-footer p.ships_from {
    text-align: center;
    margin-top: 16px!important;
}

/* Coupon Section */
.routinecos-cart-coupon {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.routinecos-coupon-question {
    font-size: 14px;
    color: #666;
    margin: 0 0 10px 0;
}

.routinecos-coupon-toggle {
    color: #ef4036;
    text-decoration: none;
    font-weight: 500;
}

.routinecos-coupon-toggle:hover {
    text-decoration: underline;
}

.routinecos-coupon-form {
    margin-top: 10px;
}

.routinecos-coupon-input-wrapper {
    display: flex;
    gap: 8px;
}

.routinecos-coupon-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.routinecos-coupon-input:focus {
    outline: none;
    border-color: #999;
}

.routinecos-coupon-button {
    padding: 10px 20px;
    background: #ef4036;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
    margin-bottom: 0!important;
}

.routinecos-coupon-button:focus,
.routinecos-coupon-button:active,
.routinecos-coupon-button:hover {
    background-color: #ef4036!important;
    color: #ffffff;
    opacity: 0.8;
}

.routinecos-coupon-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.routinecos-coupon-note {
    margin: 0;
    font-size: 11px!important;
    color: #666;
    font-style: italic;
}

.routinecos-applied-coupons {
    margin-top: 10px;
}

.routinecos-applied-coupons-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.routinecos-coupon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f0f9ff;
    border: 1px solid #d0e9ff;
    margin-bottom: 8px;
}

.routinecos-coupon-item:last-child {
    margin-bottom: 0;
}

.routinecos-coupon-code {
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    text-transform: uppercase;
}

.routinecos-remove-coupon {
    color: #999;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    margin-left: 10px;
}

.routinecos-remove-coupon:hover {
    color: #ef4036;
}

/* Coupon line item (below subtotal) */
.routinecos-cart-coupon-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
}

.routinecos-cart-coupon-label {
    font-weight: 600;
    font-size: 13px;
    color: #7d7d7d;
}

.routinecos-cart-coupon-amount {
    font-weight: 600;
    color: #7d7d7d;
    display: flex;
    align-items: center;
    gap: 8px;
}
.routinecos-cart-coupon-amount .woocommerce-Price-amount {
    color: #ef4036;
}

.routinecos-remove-coupon-link {
    color: #ef4036;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.routinecos-remove-coupon-link:hover {
    color: #ef4036;
    text-decoration: underline;
}

.routinecos-cart-subtotal {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 13px;
}

.routinecos-cart-subtotal-label {
    font-weight: 600;
    flex-shrink: 0;
    width: 60%;
}

.routinecos-cart-subtotal-amount {
    font-weight: 700;
    font-size: 13px;
    text-align: left;
    width: 40%;
}

.routinecos-cart-discount {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
    color: #0073aa;
}

.routinecos-cart-discount-label {
    font-weight: 500;
    flex-shrink: 0;
    width: 60%;
}

.routinecos-cart-discount-amount {
    font-weight: 600;
    text-align: left;
    width: 40%;
}

.routinecos-cart-shipping {
    display: flex;
    align-items: flex-start;
}

.routinecos-cart-shipping-header {
    flex-shrink: 0;
    width: 60%;
}

.routinecos-cart-shipping-methods {
    text-align: left;
    width: 40%;
}

.routinecos-cart-shipping-label {
    font-weight: 600;
    font-size: 13px;
}

.routinecos-cart-total {
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.routinecos-cart-total-label {
    font-weight: 600;
}
.routinecos-cart-total-amount {
    font-weight: 600;
    font-size: 20px!important;
}

.routinecos-cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.routinecos-cart-button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.routinecos-cart-button.primary {
    background: #ef4036;
    color: #fff!important;
    text-transform: uppercase;
}

.routinecos-cart-button.primary:hover {
    text-decoration: none;
    opacity: 0.8;
}

.routinecos-cart-button.secondary {
    background: #f5f5f5;
    color: #333;
}

.routinecos-cart-button.secondary:hover {
    background: #e0e0e0;
}

/* Prevent body scroll when cart is open */
body.routinecos-cart-open {
    overflow: hidden;
}

/* Loading state for single add to cart button */
.single_add_to_cart_button.loading {
    opacity: 0.7;
    position: relative;
    pointer-events: none;
}

.single_add_to_cart_button.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Gift toggle checkbox styling */
.routinecos-gift-toggle {
    padding: 15px;
    margin-top: 15px;
}

.routinecos-gift-toggle-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: #7d7d7d;
    margin: 0;
}

.routinecos-gift-toggle-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.routinecos-gift-toggle-text {
    flex: 1;
}

/* Subscribe and Save */
.routinecos-subscribe-save-wrapper {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    transition: opacity 0.2s ease;
}

.routinecos-subscribe-toggle {
    display: block;
}

.routinecos-subscribe-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #7d7d7d;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.routinecos-subscribe-checkbox {
    width: 16px;
    height: 16px;
    margin: 0 0 4px 0!important;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #7d7d7d;
}

.routinecos-subscribe-text {
    flex: 1;
}

.routinecos-subscribe-info {
    color: #999;
    cursor: pointer;
    font-style: normal;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.routinecos-subscribe-info:hover {
    color: #666;
}

.routinecos-subscribe-info .fa-info-circle {
    font-size: 14px;
}

/* Mobile touch target improvement for subscribe info tooltip */
@media (max-width: 767px) {
    .routinecos-subscribe-info {
        min-width: 32px;
        min-height: 32px;
        margin-left: 0;
        margin-right: -8px;
    }
    
    .routinecos-subscribe-info .fa-info-circle {
        font-size: 16px;
    }
}

.routinecos-frequency-selector {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8e8e8;
}

.routinecos-frequency-dropdown {
    width: 100%;
    padding: 10px 14px;
    padding-right: 25px;
    border: 1px solid #d2d4d6;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNiIgaGVpZ2h0PSIxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0tNy01aDIwdjIwSC03eiIvPjxwYXRoIGQ9Ik02IDNIMGwzLTMgMyAzem0tLjEgNEwzIDkuOS4xIDdoNS44eiIgZmlsbD0iIzlDQTBBNiIvPjwvZz48L3N2Zz4=');
    background-position: calc(100% - 15px) 50%;
    background-repeat: no-repeat;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.routinecos-frequency-dropdown:focus {
    outline: none;
    border-color: #7d7d7d;
}

/* Subscribe wrapper states */
.routinecos-subscribe-save-wrapper.checked {
    /*background: #fff5f5;*/
    border-color: #7d7d7d;
}

.routinecos-subscribe-save-wrapper.unchecked .routinecos-subscribe-label {
    color: #666;
}

.routinecos-subscribe-save-wrapper.unchecked .routinecos-subscribe-label:hover {
    color: #7d7d7d;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .routinecos-cart-panel {
        max-width: 100%;
    }
    
    .routinecos-subscribe-save-wrapper {
        margin-top: 8px;
        padding: 8px 10px;
    }
    
    .routinecos-subscribe-label {
        font-size: 12px;
    }
    
    .routinecos-frequency-dropdown {
        font-size: 12px;
        padding: 8px 10px;
        padding-right: 25px;
    }
}

