/**
 * NunuFresh Modern Styling Enhancements
 * Preserves all existing functionality while adding modern visual polish
 */

/* ============================================
   MODERN PRODUCT CARDS & LISTINGS
   ============================================ */

/* Keep default theme styling - minimal overrides only */

/* ============================================
   SINGLE PRODUCT PAGE ENHANCEMENTS
   ============================================ */

/* Product Summary Section */
.single-product .summary {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Product Title */
.single-product .product_title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Product Price on Single Page */
.single-product .price {
    font-size: 2rem;
    color: #27ae60;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 10px;
    display: inline-block;
}

/* Product Description */
.single-product .woocommerce-product-details__short-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1.5rem;
}

/* Product Meta */
.single-product .product_meta {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 2rem;
}

.single-product .product_meta > span {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #666;
}

/* Product Images Gallery */
.single-product .woocommerce-product-gallery {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.single-product .woocommerce-product-gallery__image {
    border-radius: 12px;
    overflow: hidden;
}

/* Quantity Input */
.quantity input.qty {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.3s ease;
    width: 80px;
}

.quantity input.qty:focus {
    border-color: #27ae60;
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* ============================================
   SUBSCRIPTION PLANS STYLING
   ============================================ */

/* Subscription Product Cards - Use flexbox with order control */
.products .product[class*="7413"],
.products .product[class*="7414"],
.products .product[class*="7415"] {
    position: relative;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    min-height: 600px;
}

/* Legacy subscription product class support */
.product.subscription-product {
    position: relative;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    min-height: 600px;
}

.product.subscription-product::before {
    content: "Subscription";
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.product.subscription-product:hover {
    border-color: #3498db;
    box-shadow: 0 12px 32px rgba(52, 152, 219, 0.15);
}

/* Order 1: Product thumbnail - fixed height */
.product.subscription-product .product-thumbnail,
.products .product[class*="7413"] .product-thumbnail,
.products .product[class*="7414"] .product-thumbnail,
.products .product[class*="7415"] .product-thumbnail {
    order: 1;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    flex-shrink: 0;
}

.product.subscription-product .product-thumbnail img,
.products .product[class*="7413"] .product-thumbnail img,
.products .product[class*="7414"] .product-thumbnail img,
.products .product[class*="7415"] .product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Order 2: Product title - fixed height */
.product.subscription-product .woocommerce-loop-product__title,
.products .product[class*="7413"] .woocommerce-loop-product__title,
.products .product[class*="7414"] .woocommerce-loop-product__title,
.products .product[class*="7415"] .woocommerce-loop-product__title {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 15px !important;
    padding: 0 !important;
    text-align: center;
    flex-shrink: 0;
    min-height: 50px;
}

/* Order 3: Price section - FIXED height, appears after title */
.product.subscription-product .price,
.products .product[class*="7413"] .price,
.products .product[class*="7414"] .price,
.products .product[class*="7415"] .price {
    order: 3 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #27ae60 !important;
    margin: 10px 15px !important;
    text-align: center !important;
    padding: 15px 10px !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    height: 80px !important;
    flex-shrink: 0 !important;
}

/* Force price elements to stay on one line */
.product.subscription-product .price .woocommerce-Price-amount,
.products .product[class*="7413"] .price .woocommerce-Price-amount,
.products .product[class*="7414"] .price .woocommerce-Price-amount,
.products .product[class*="7415"] .price .woocommerce-Price-amount {
    display: inline !important;
    white-space: nowrap !important;
}

.product.subscription-product .price .woocommerce-Price-currencySymbol,
.products .product[class*="7413"] .price .woocommerce-Price-currencySymbol,
.products .product[class*="7414"] .price .woocommerce-Price-currencySymbol,
.products .product[class*="7415"] .price .woocommerce-Price-currencySymbol {
    display: inline !important;
}

/* Style for subscription frequency text */
.product.subscription-product .subscription-price-string,
.products .product[class*="7413"] .subscription-price-string,
.products .product[class*="7414"] .subscription-price-string,
.products .product[class*="7415"] .subscription-price-string {
    display: inline !important;
    white-space: nowrap !important;
    font-size: 0.85em !important;
    margin-left: 5px !important;
}

/* Order 4: Short description paragraph */
.product.subscription-product > p:first-of-type,
.products .product[class*="7413"] > p:first-of-type,
.products .product[class*="7414"] > p:first-of-type,
.products .product[class*="7415"] > p:first-of-type {
    order: 4;
    margin: 0 15px 10px 15px !important;
    padding: 0 !important;
    font-size: 0.9rem;
    text-align: center;
    flex-shrink: 0;
}

/* Order 5: Product description with bullet points - FLEXIBLE HEIGHT */
.product.subscription-product .product-summary,
.product.subscription-product .woocommerce-product-details__short-description,
.product.subscription-product ul,
.products .product[class*="7413"] .product-summary,
.products .product[class*="7413"] ul,
.products .product[class*="7414"] .product-summary,
.products .product[class*="7414"] ul,
.products .product[class*="7415"] .product-summary,
.products .product[class*="7415"] ul {
    order: 5;
    margin: 0 15px 15px 15px !important;
    padding: 0 !important;
    font-size: 0.95rem;
    line-height: 1.8;
    flex-grow: 1;
}

/* Style lists in subscription descriptions */
.product.subscription-product ul,
.products .product[class*="7413"] ul,
.products .product[class*="7414"] ul,
.products .product[class*="7415"] ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

.product.subscription-product ul li,
.products .product[class*="7413"] ul li,
.products .product[class*="7414"] ul li,
.products .product[class*="7415"] ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 8px;
}

.product.subscription-product ul li::before,
.products .product[class*="7413"] ul li::before,
.products .product[class*="7414"] ul li::before,
.products .product[class*="7415"] ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Convert comma-separated features to bullet points */
.product.subscription-product .woocommerce-product-details__short-description,
.products .product[class*="7413"] .woocommerce-product-details__short-description,
.products .product[class*="7414"] .woocommerce-product-details__short-description,
.products .product[class*="7415"] .woocommerce-product-details__short-description {
    text-align: left;
}

/* Order 6: Subscribe button - FIXED at bottom, SAME HEIGHT */
.product.subscription-product .button,
.product.subscription-product a.button,
.products .product[class*="7413"] .button,
.products .product[class*="7413"] a.button,
.products .product[class*="7414"] .button,
.products .product[class*="7414"] a.button,
.products .product[class*="7415"] .button,
.products .product[class*="7415"] a.button {
    order: 6 !important;
    width: calc(100% - 30px) !important;
    margin: 0 15px 15px 15px !important;
    padding: 15px 20px !important;
    text-align: center !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

/* Ensure all subscription cards have equal heights */
.products .product.subscription-product,
.products .product[class*="7413"],
.products .product[class*="7414"],
.products .product[class*="7415"] {
    display: flex !important;
    flex-direction: column !important;
}

/* Subscription plan pricing alignment in table format */
.subscription-plans-table {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.subscription-plans-table .product {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================
   CHECKOUT PAGE ENHANCEMENTS
   ============================================ */

/* Force payment section to always be visible */
#payment,
.woocommerce-checkout-payment,
#payment ul.payment_methods,
.wc_payment_methods {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Ensure payment methods list is visible */
.woocommerce-checkout #payment ul.payment_methods li {
    display: block !important;
    visibility: visible !important;
}

/* Force payment box to show */
#payment div.payment_box,
#payment .payment_box.payment_method_stripe,
.woocommerce-checkout #payment .payment_box {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
}

/* Ensure Stripe card elements are visible */
#stripe-card-element,
.wc-stripe-elements-field,
.wc-stripe-upe-element,
.__PrivateStripeElement {
    display: block !important;
    visibility: visible !important;
    min-height: 40px !important;
}

/* Ensure place order button is always visible */
#payment #place_order,
.woocommerce-checkout #payment button#place_order {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================
   CHECKOUT PAGE STYLING
   ============================================ */

/* Checkout Form */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout #order_review_heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #27ae60;
}

.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 12px 16px;
    transition: border-color 0.3s ease;
}

.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row textarea:focus,
.woocommerce-checkout .form-row select:focus {
    border-color: #27ae60;
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Order Review Table */
#order_review table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#order_review table th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    font-weight: 600;
    padding: 15px;
}

#order_review table td {
    padding: 15px;
    vertical-align: middle;
}

/* Place Order Button */
#place_order {
    width: 100%;
    padding: 18px 32px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#place_order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

/* ============================================
   ORDER PAY PAGE
   ============================================ */

/* Order Pay Page Container - only affects body content, not header/nav */
.woocommerce-order-pay #order_review_heading,
.woocommerce-order-pay #order_review,
.woocommerce-order-pay #payment,
.woocommerce-order-pay .woocommerce-info,
.woocommerce-order-pay .woocommerce-notice {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.woocommerce-order-pay {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Order Pay Main Content */
.woocommerce-order-pay #order_review {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

/* Order Pay Table */
.woocommerce-order-pay table.shop_table {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

.woocommerce-order-pay table.shop_table th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px;
    font-weight: 600;
}

.woocommerce-order-pay table.shop_table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

/* Order Pay Payment Section */
.woocommerce-order-pay #payment {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-top: 20px;
}

/* Order Pay Heading */
.woocommerce-order-pay h2,
.woocommerce-order-pay h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #27ae60;
}

/* Order Pay Notice */
.woocommerce-order-pay .woocommerce-info,
.woocommerce-order-pay .woocommerce-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 5px solid #2196f3;
    padding: 20px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 1rem;
}

/* Order Total on Pay Page */
.woocommerce-order-pay .order-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #27ae60;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 15px;
    border-radius: 8px;
}

/* Payment Methods on Pay Page */
.woocommerce-order-pay .wc_payment_methods {
    margin: 20px 0;
}

.woocommerce-order-pay .wc_payment_method {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.woocommerce-order-pay .wc_payment_method.payment_method_stripe {
    border-color: #27ae60;
}

/* Place Order Button on Pay Page */
.woocommerce-order-pay #place_order {
    width: 100%;
    padding: 18px 32px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
    transition: all 0.3s ease;
    border: none;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.woocommerce-order-pay #place_order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

/* Responsive Order Pay Page */
@media (max-width: 768px) {
    .woocommerce-order-pay {
        padding: 20px 15px;
    }

    .woocommerce-order-pay #order_review,
    .woocommerce-order-pay #payment {
        padding: 20px;
    }

    .woocommerce-order-pay h2,
    .woocommerce-order-pay h3 {
        font-size: 1.5rem;
    }

    .woocommerce-order-pay #place_order {
        font-size: 1rem;
        padding: 15px 24px;
    }
}

/* ============================================
   ORDER RECEIVED PAGE
   ============================================ */

/* Order Received Banner */
.woocommerce-order-received .woocommerce-notice,
.woocommerce-order-received .woocommerce-message {
    border-radius: 12px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border: none;
    font-size: 1.3rem;
    font-weight: 700;
    color: white !important;
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
    margin-bottom: 30px;
    text-align: center;
}

.woocommerce-order-received .woocommerce-notice::before,
.woocommerce-order-received .woocommerce-message::before {
    color: white !important;
    font-size: 1.5rem;
    margin-right: 10px;
}

/* Ensure all text in success message is white */
.woocommerce-notice,
.woocommerce-message {
    color: white !important;
}

.woocommerce-notice a,
.woocommerce-message a {
    color: white !important;
    text-decoration: underline;
}

.woocommerce-order-received .woocommerce-order-details,
.woocommerce-order-received .woocommerce-customer-details {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.woocommerce-order-details__title,
.woocommerce-customer-details .woocommerce-column__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #27ae60;
}

/* ============================================
   TYPOGRAPHY ENHANCEMENTS
   ============================================ */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #2c3e50;
}

/* Paragraphs */
p {
    line-height: 1.7;
    color: #555;
}

/* Links */
a {
    transition: color 0.3s ease;
}

a:hover {
    color: #27ae60;
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

/* Input Fields */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 12px 16px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #27ae60;
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Buttons */
.button,
button,
input[type="submit"] {
    border-radius: 8px;
    padding: 12px 28px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    .single-product .product_title {
        font-size: 1.75rem;
    }

    .single-product .price {
        font-size: 1.5rem;
        padding: 12px 16px;
    }

    .single-product .summary {
        padding: 20px;
    }

    #place_order {
        font-size: 1rem;
        padding: 15px 24px;
    }
}

/* ============================================
   MODERN BADGES & LABELS
   ============================================ */

/* Sale Badge - Eye-catching */
.onsale,
.woocommerce span.onsale {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
    border-radius: 25px;
    padding: 8px 18px;
    font-weight: 700;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* New Badge */
.products .product.new-product::before,
.woocommerce ul.products li.product.new-product::before {
    content: 'New';
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Star Rating - Professional */
.woocommerce .star-rating {
    color: #f39c12;
    font-size: 1rem;
}

.woocommerce .star-rating::before {
    color: #e0e0e0;
}

/* Stock Badge - Clear status */
.in-stock,
.out-of-stock {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.in-stock {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.out-of-stock {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* Quick View & Wishlist Icons - Modern hover effects */
.products .product .product-buttons,
.woocommerce ul.products li.product .product-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.products .product:hover .product-buttons,
.woocommerce ul.products li.product:hover .product-buttons {
    opacity: 1;
}

.products .product .product-buttons a,
.woocommerce ul.products li.product .product-buttons a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.products .product .product-buttons a:hover,
.woocommerce ul.products li.product .product-buttons a:hover {
    background: #27ae60;
    color: white;
    transform: scale(1.1);
}

/* ============================================
   LOADING & TRANSITIONS
   ============================================ */

.blockUI.blockOverlay {
    border-radius: 12px !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus Visible */
*:focus-visible {
    outline: 3px solid #27ae60;
    outline-offset: 2px;
}

/* Skip to Content */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #27ae60;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}
