/**
 * Frontend Styles
 * 
 * Styles for layouts displayed on the front-end.
 * 
 * @package KramitBuilder
 * @since   1.0.0
 */

/* Layout Container */
.kramit-builder-layout {
    position: relative !important;
    width: 100%;
    max-width: 1400px;
    min-height: 400px;
    margin: 0 auto !important;
    overflow: visible !important;
    isolation: isolate;
    display: block !important;
    clear: both !important;
}

/* Responsive container width */
@media (max-width: 768px) {
    .kramit-builder-layout {
        max-width: 768px;
    }
}

@media (max-width: 480px) {
    .kramit-builder-layout {
        max-width: 480px;
    }
}

/* Individual Widgets */
.kramit-widget {
    box-sizing: border-box;
    position: absolute !important;
}

/* Allow content widgets to expand */
.kramit-widget-product-grid,
.kramit-widget-category-list {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Ensure child elements don't get clipped */
.kramit-widget-product-grid > *,
.kramit-widget-category-list > * {
    overflow: visible !important;
}

/* Ensure images scale within their containers */
.kramit-widget img {
    max-width: 100%;
    height: auto;
}

/* Text Widget */
.kramit-text-widget {
    line-height: 1.6;
    padding: 15px;
}

/* Heading Widget */
.kramit-heading-widget {
    padding: 15px;
}

/* Button Widget */
.kramit-button-widget {
    padding: 15px;
}

.kramit-button-widget a {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Image Widget */
.kramit-image-widget {
    padding: 0;
}

.kramit-image-widget img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Carousel Widget */
.kramit-carousel-widget {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.kramit-carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.kramit-carousel-slide {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
}

.kramit-carousel-slide.active {
    display: block;
}

.kramit-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kramit-carousel-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 20px;
    border-radius: 4px;
}

.kramit-carousel-arrows {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.kramit-carousel-arrow {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    pointer-events: all;
    transition: background 0.3s;
}

.kramit-carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.kramit-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.kramit-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.kramit-carousel-dot.active {
    background: rgba(255, 255, 255, 1);
}

/* Responsive */
@media (max-width: 768px) {
    .kramit-carousel-content {
        padding: 15px;
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}

/* Premium Widget Notice */
.kramit-premium-widget-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    text-align: center;
}

.kramit-premium-notice-content {
    max-width: 400px;
}

.kramit-premium-widget-notice .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}

.kramit-premium-widget-notice h3 {
    margin: 0 0 10px 0;
    color: #fff;
}

.kramit-premium-widget-notice p {
    margin: 0 0 20px 0;
}

.kramit-upgrade-button {
    display: inline-block;
    padding: 12px 24px;
    background: #fff;
    color: #667eea;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s;
}

.kramit-upgrade-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Advanced Slider Styles */
.kramit-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.kramit-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.kramit-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kramit-slide.active {
    opacity: 1;
    position: relative;
}

.kramit-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.kramit-slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 40px;
    max-width: 800px;
}

.kramit-slide-title {
    font-size: 48px;
    font-weight: bold;
    margin: 0 0 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.kramit-slide-description {
    font-size: 20px;
    margin: 0 0 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.kramit-slide-button {
    display: inline-block;
    padding: 15px 40px;
    background: #667eea;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.kramit-slide-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.kramit-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kramit-slider-arrow:hover {
    background: rgba(255, 255, 255, 0.5);
}

.kramit-slider-prev {
    left: 20px;
}

.kramit-slider-next {
    right: 20px;
}

.kramit-slider-arrow .dashicons {
    color: #fff;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.kramit-slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.kramit-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.kramit-slider-dot.active,
.kramit-slider-dot:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .kramit-slide-title {
        font-size: 32px;
    }
    
    .kramit-slide-description {
        font-size: 16px;
    }
    
    .kramit-slide-button {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .kramit-slider-arrow {
        width: 40px;
        height: 40px;
    }
    
    .kramit-slider-prev {
        left: 10px;
    }
    
    .kramit-slider-next {
        right: 10px;
    }
}

/* Small Desktop / Large Tablet (1024px - 1200px) */
@media (max-width: 1200px) and (min-width: 1025px) {
    .kramit-builder-layout {
        display: flex !important;
        flex-wrap: wrap !important;
        min-height: auto !important;
    }
    
    .kramit-builder-layout .kramit-widget {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        flex-shrink: 0;
    }
    
    /* Filter sidebar */
    .kramit-widget-product-filter {
        width: 22% !important;
        min-width: 220px;
        margin-right: 25px;
    }
    
    /* Product grid takes remaining space */
    .kramit-widget-product-grid {
        width: calc(78% - 25px) !important;
        flex: 1;
    }
    
    /* Reduce columns slightly */
    .kramit-product-grid.columns-5,
    .kramit-product-grid.columns-6 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet Layout (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .kramit-builder-layout {
        display: flex !important;
        flex-wrap: wrap !important;
        min-height: auto !important;
    }
    
    .kramit-builder-layout .kramit-widget {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        flex-shrink: 0;
    }
    
    /* Filter sidebar takes ~25% on tablet */
    .kramit-widget-product-filter {
        width: 25% !important;
        min-width: 200px;
        margin-right: 20px;
    }
    
    /* Product grid takes remaining space */
    .kramit-widget-product-grid {
        width: calc(75% - 20px) !important;
        flex: 1;
    }
    
    /* Reduce product grid to 2-3 columns on tablet */
    .kramit-product-grid.columns-4,
    .kramit-product-grid.columns-5,
    .kramit-product-grid.columns-6 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .kramit-product-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile Layout - Stack widgets vertically */
@media (max-width: 768px) {
    .kramit-builder-layout {
        display: flex !important;
        flex-direction: column !important;
        min-height: auto !important;
    }
    
    .kramit-builder-layout .kramit-widget {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        margin-bottom: 20px;
    }
    
    /* Product filter mobile toggle */
    .kramit-widget-product-filter {
        order: -1; /* Put filter first on mobile */
    }
    
    .kramit-product-filter {
        position: relative;
    }
    
    .kramit-filter-toggle {
        display: block;
        width: 100%;
        padding: 12px 20px;
        background: #0073aa;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-weight: 600;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .kramit-filter-toggle::before {
        content: "☰ ";
    }
    
    .kramit-product-filter .product-filter-form {
        display: none;
        padding: 15px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 5px;
    }
    
    .kramit-product-filter.filter-open .product-filter-form {
        display: block;
    }
    
    /* Product grid 2 columns on larger phones */
    .kramit-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Small mobile devices - single column */
@media (max-width: 480px) {
    .kramit-builder-layout .kramit-widget {
        margin-bottom: 15px;
    }
    
    .kramit-product-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .kramit-product-item {
        margin: 0 5px;
    }
}

/* =========================================
   Responsive Visibility
   ========================================= */

/* Desktop - above 1024px */
@media (min-width: 1025px) {
    .kramit-hide-desktop {
        display: none !important;
    }
}

/* Tablet - 768px to 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    .kramit-hide-tablet {
        display: none !important;
    }
}

/* Mobile - below 768px */
@media (max-width: 767px) {
    .kramit-hide-mobile {
        display: none !important;
    }
}

/* =========================================
   Entrance Animations
   ========================================= */

.kramit-animated {
    animation-duration: var(--kramit-animation-duration, 1s);
    animation-delay: var(--kramit-animation-delay, 0s);
    animation-fill-mode: both;
}

/* Fade Animations */
@keyframes kramitFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes kramitFadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes kramitFadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes kramitFadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes kramitFadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.kramit-animation-fadeIn { animation-name: kramitFadeIn; }
.kramit-animation-fadeInUp { animation-name: kramitFadeInUp; }
.kramit-animation-fadeInDown { animation-name: kramitFadeInDown; }
.kramit-animation-fadeInLeft { animation-name: kramitFadeInLeft; }
.kramit-animation-fadeInRight { animation-name: kramitFadeInRight; }

/* Slide Animations */
@keyframes kramitSlideInUp {
    from {
        transform: translate3d(0, 100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes kramitSlideInDown {
    from {
        transform: translate3d(0, -100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes kramitSlideInLeft {
    from {
        transform: translate3d(-100%, 0, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes kramitSlideInRight {
    from {
        transform: translate3d(100%, 0, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

.kramit-animation-slideInUp { animation-name: kramitSlideInUp; }
.kramit-animation-slideInDown { animation-name: kramitSlideInDown; }
.kramit-animation-slideInLeft { animation-name: kramitSlideInLeft; }
.kramit-animation-slideInRight { animation-name: kramitSlideInRight; }

/* Zoom Animations */
@keyframes kramitZoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
}

@keyframes kramitZoomInUp {
    from {
        opacity: 0;
        transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
    }
}

@keyframes kramitZoomInDown {
    from {
        opacity: 0;
        transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
    }
}

.kramit-animation-zoomIn { animation-name: kramitZoomIn; }
.kramit-animation-zoomInUp { animation-name: kramitZoomInUp; }
.kramit-animation-zoomInDown { animation-name: kramitZoomInDown; }

/* Bounce Animations */
@keyframes kramitBounce {
    from, 20%, 53%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -30px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes kramitBounceIn {
    from, 20%, 40%, 60%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes kramitBounceInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 3000px, 0);
    }
    60% {
        opacity: 1;
        transform: translate3d(0, -20px, 0);
    }
    75% {
        transform: translate3d(0, 10px, 0);
    }
    90% {
        transform: translate3d(0, -5px, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes kramitBounceInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -3000px, 0);
    }
    60% {
        opacity: 1;
        transform: translate3d(0, 25px, 0);
    }
    75% {
        transform: translate3d(0, -10px, 0);
    }
    90% {
        transform: translate3d(0, 5px, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

.kramit-animation-bounce { animation-name: kramitBounce; }
.kramit-animation-bounceIn { animation-name: kramitBounceIn; }
.kramit-animation-bounceInUp { animation-name: kramitBounceInUp; }
.kramit-animation-bounceInDown { animation-name: kramitBounceInDown; }

/* Rotate Animations */
@keyframes kramitRotateIn {
    from {
        transform-origin: center;
        transform: rotate3d(0, 0, 1, -200deg);
        opacity: 0;
    }
    to {
        transform-origin: center;
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

@keyframes kramitFlipInX {
    from {
        transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
        animation-timing-function: ease-in;
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
        animation-timing-function: ease-in;
    }
    60% {
        transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    }
    to {
        transform: perspective(400px);
    }
}

@keyframes kramitFlipInY {
    from {
        transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
        animation-timing-function: ease-in;
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
        animation-timing-function: ease-in;
    }
    60% {
        transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
    }
    to {
        transform: perspective(400px);
    }
}

.kramit-animation-rotateIn { animation-name: kramitRotateIn; }
.kramit-animation-flipInX { animation-name: kramitFlipInX; }
.kramit-animation-flipInY { animation-name: kramitFlipInY; }


/* ==========================================================================
   WooCommerce Product Template Widgets
   ========================================================================== */

/* Product Template Container */
.kramit-product-template {
    display: block;
    position: relative;
}

.kramit-product-template .kramit-builder-layout {
    position: relative;
}

/* Add to Cart Widget - ensure proper spacing */
.kramit-add-to-cart {
    padding: 15px 0;
    clear: both;
}

.kramit-add-to-cart .cart,
.kramit-add-to-cart form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.kramit-add-to-cart .quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.kramit-add-to-cart .quantity input,
.kramit-add-to-cart .quantity-input {
    width: 70px;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.kramit-add-to-cart .add-to-cart-button,
.kramit-add-to-cart .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.kramit-add-to-cart .product-price {
    margin-bottom: 15px;
}

/* Product Meta Widget - proper spacing and line height */
.kramit-product-meta {
    padding: 15px 0;
    line-height: 1.8;
    clear: both;
}

.kramit-product-meta .meta-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kramit-product-meta .meta-item {
    margin-bottom: 8px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.kramit-product-meta .meta-item:last-child {
    margin-bottom: 0;
}

.kramit-product-meta .meta-label {
    font-weight: 600;
}

.kramit-product-meta a {
    text-decoration: none;
    transition: color 0.2s ease;
}

.kramit-product-meta a:hover {
    text-decoration: underline;
}

/* Product Title Widget */
.kramit-product-title {
    padding: 10px 0;
    margin-bottom: 10px;
}

.kramit-product-title h1,
.kramit-product-title h2 {
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

/* Product Price Widget */
.kramit-product-price {
    padding: 10px 0;
    margin-bottom: 10px;
}

.kramit-product-price .price {
    font-size: inherit;
    margin: 0;
}

.kramit-product-price del {
    opacity: 0.6;
    margin-right: 8px;
}

.kramit-product-price ins {
    text-decoration: none;
}

/* Product Short Description Widget */
.kramit-product-short-description {
    padding: 15px 0;
    margin-bottom: 10px;
    line-height: 1.6;
}

.kramit-product-short-description p {
    margin: 0 0 10px 0;
}

.kramit-product-short-description p:last-child {
    margin-bottom: 0;
}

/* Product Rating Widget */
.kramit-product-rating {
    padding: 10px 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kramit-product-rating .star-rating {
    font-size: inherit;
}

/* Product Gallery Widget */
.kramit-product-gallery {
    padding: 10px 0;
}

.kramit-product-gallery .woocommerce-product-gallery {
    margin: 0;
}

/* Product Tabs Widget */
.kramit-product-tabs {
    padding: 20px 0;
    margin-top: 20px;
}

/* Product Stock Widget */
.kramit-product-stock {
    padding: 10px 0;
    margin-bottom: 10px;
}

/* Ensure widgets don't overlap in product templates */
.kramit-product-template .kramit-widget {
    z-index: 1;
}

/* Override absolute positioning issues for key product widgets */
.kramit-product-template .kramit-widget[class*="product-meta"],
.kramit-product-template .kramit-widget[class*="add-to-cart"] {
    overflow: visible !important;
}

/* Responsive adjustments for product template */
@media (max-width: 768px) {
    .kramit-add-to-cart .cart,
    .kramit-add-to-cart form.cart {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kramit-add-to-cart .quantity-wrapper {
        margin-bottom: 10px;
    }
    
    .kramit-add-to-cart .quantity input,
    .kramit-add-to-cart .quantity-input {
        width: 100%;
    }
    
    .kramit-add-to-cart .add-to-cart-button,
    .kramit-add-to-cart .single_add_to_cart_button {
        width: 100%;
    }
    
    .kramit-product-meta .meta-item {
        flex-direction: column;
        gap: 2px;
    }
}

/* ==========================================================================
   Product Grid - Title Truncation
   High specificity to override theme styles (e.g., Flatsome)
   ========================================================================== */

.kramit-product-grid .kramit-product-item .kramit-product-content h3.kramit-product-title,
.kramit-product-grid .kramit-product-content h3.kramit-product-title,
h3.kramit-product-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3em !important;
    min-height: 2.6em !important;
    max-height: 2.6em !important;
    height: 2.6em !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    word-break: break-word !important;
    position: relative !important;
    z-index: 10 !important;
    background: #fff !important;
}

.kramit-product-grid .kramit-product-item .kramit-product-content h3.kramit-product-title a,
.kramit-product-grid .kramit-product-content h3.kramit-product-title a,
h3.kramit-product-title a {
    display: inline !important;
    color: #333 !important;
    text-decoration: none !important;
    -webkit-box-decoration-break: clone !important;
    box-decoration-break: clone !important;
}

.kramit-product-grid .kramit-product-item .kramit-product-content h3.kramit-product-title a:hover,
h3.kramit-product-title a:hover {
    color: #0066cc !important;
}

/* Price section - tighter spacing */
.kramit-product-grid .kramit-product-item .kramit-product-content .kramit-product-footer,
.kramit-product-content .kramit-product-footer {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    clear: both !important;
}

.kramit-product-grid .kramit-product-item .kramit-product-content .kramit-product-price,
.kramit-product-content .kramit-product-price {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}