/**
 * Grid Block Styles
 */

.apb-grid-block {
    margin: 30px 0;
}

.apb-grid-container {
    display: grid;
    grid-template-columns: repeat(var(--apb-grid-columns, 3), 1fr);
    gap: var(--apb-grid-gap, 20px);
}

.apb-grid-item {
    display: flex;
}

.apb-product-card {
    flex: 1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--apb-border-radius, 8px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* Equal Height */
.apb-equal-height .apb-grid-container {
    align-items: stretch;
}

.apb-equal-height .apb-product-card {
    height: 100%;
}

/* Shadow Styles */
.apb-shadow-none .apb-product-card {
    box-shadow: none;
}

.apb-shadow-light .apb-product-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.apb-shadow-medium .apb-product-card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.apb-shadow-heavy .apb-product-card {
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

/* Hover Effects */
.apb-hover-lift .apb-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.apb-hover-scale .apb-product-card:hover {
    transform: scale(1.02);
}

.apb-hover-darken .apb-product-card:hover {
    background: #f9fafb;
}

.apb-hover-pulse .apb-product-card:hover {
    animation: pulse 0.5s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Card Elements */
.apb-card-image {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #f3f4f6;
}

.apb-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apb-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.apb-card-title {
    margin: 0 0 10px;
    font-size: 1.2em;
    line-height: 1.4;
}

.apb-card-title a {
    color: #111827;
    text-decoration: none;
}

.apb-card-title a:hover {
    color: var(--apb-primary-color, #FF9900);
}

.apb-card-rating {
    margin: 10px 0;
    font-size: 0.9em;
}

.apb-card-description {
    margin: 10px 0;
    flex: 1;
    color: #6b7280;
    line-height: 1.5;
}

.apb-card-price {
    margin: 15px 0;
    font-size: 1.1em;
}

.apb-card-price .apb-original-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.9em;
    display: block;
}

.apb-card-price .apb-current-price {
    color: var(--apb-accent-color, #B12704);
    font-weight: bold;
    font-size: 1.3em;
    display: block;
}

.apb-card-price .apb-savings {
    color: #10b981;
    font-size: 0.85em;
    display: block;
    margin-top: 5px;
}

.apb-card-button {
    margin-top: auto;
}

.apb-grid-button {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.apb-grid-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Button Sizes */
.apb-grid-button.apb-btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.apb-grid-button.apb-btn-medium {
    padding: 12px 24px;
    font-size: 1em;
}

.apb-grid-button.apb-btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
}

/* Button Styles */
.apb-grid-button.apb-btn-solid {
    /* Styles applied inline via PHP */
}

.apb-grid-button.apb-btn-outline {
    /* Styles applied inline via PHP */
    background-color: transparent !important;
}

.apb-grid-button.apb-btn-outline:hover {
    background-color: currentColor !important;
    color: #fff !important;
}

.apb-grid-button.apb-btn-gradient {
    /* Styles applied inline via PHP */
    position: relative;
    overflow: hidden;
}

.apb-grid-button.apb-btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.apb-grid-button.apb-btn-gradient:hover::before {
    left: 100%;
}

/* Grid Styles */
.apb-grid-style-list .apb-grid-container {
    grid-template-columns: 1fr;
}

.apb-grid-style-list .apb-product-card {
    flex-direction: row;
}

.apb-grid-style-list .apb-card-image {
    flex: 0 0 200px;
    padding-top: 0;
    height: 200px;
}

.apb-grid-style-masonry .apb-grid-container {
    display: block;
    column-count: var(--apb-grid-columns, 3);
    column-gap: var(--apb-grid-gap, 20px);
}

.apb-grid-style-masonry .apb-grid-item {
    break-inside: avoid;
    margin-bottom: var(--apb-grid-gap, 20px);
}

/* Responsive */
@media (max-width: 1024px) {
    .apb-grid-container {
        grid-template-columns: repeat(var(--apb-grid-columns-tablet, 2), 1fr);
    }

    .apb-grid-style-masonry .apb-grid-container {
        column-count: var(--apb-grid-columns-tablet, 2);
    }
}

@media (max-width: 768px) {
    .apb-grid-container {
        grid-template-columns: repeat(var(--apb-grid-columns-mobile, 1), 1fr);
    }

    .apb-grid-style-masonry .apb-grid-container {
        column-count: var(--apb-grid-columns-mobile, 1);
    }

    .apb-grid-style-list .apb-product-card {
        flex-direction: column;
    }

    .apb-grid-style-list .apb-card-image {
        flex: 0 0 auto;
        padding-top: 75%;
        height: auto;
    }
}
