/* ===== WC Product Combos - Frontend Styles ===== */

/* --- Combo Grid (Archive) --- */
.wcpc-combos-grid {
    display: grid;
    gap: 24px;
    margin: 30px 0;
}
.wcpc-combos-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.wcpc-combos-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.wcpc-combos-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.wcpc-combos-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
    .wcpc-combos-grid.columns-4,
    .wcpc-combos-grid.columns-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .wcpc-combos-grid.columns-3,
    .wcpc-combos-grid.columns-4,
    .wcpc-combos-grid.columns-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .wcpc-combos-grid { grid-template-columns: 1fr !important; }
}

/* --- Combo Card --- */
.wcpc-combo-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.wcpc-combo-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.wcpc-combo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Featured image (set on the combo itself) */
.wcpc-combo-featured {
    position: relative;
    background: #f7f7f7;
    aspect-ratio: 1;
    overflow: hidden;
}
.wcpc-combo-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback collage when no featured image is set */
.wcpc-combo-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 2px;
    position: relative;
    background: #f7f7f7;
    aspect-ratio: 1;
    overflow: hidden;
}
.wcpc-combo-images.count-1 { grid-template-columns: 1fr; }
.wcpc-combo-images.count-2 { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100%; }
.wcpc-combo-images.count-3 .wcpc-combo-thumb:first-child { grid-column: span 2; }
.wcpc-combo-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wcpc-combo-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
}

.wcpc-combo-card-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
}
.wcpc-combo-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
    color: #222;
}
.wcpc-combo-card-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.wcpc-combo-card-price .wcpc-mrp {
    font-size: 13px;
    color: #999;
}
.wcpc-combo-card-price .wcpc-price {
    font-size: 17px;
    font-weight: 700;
    color: #222;
}

.wcpc-combo-card .wcpc-add-combo-to-cart {
    margin: 0 16px 16px;
    padding: 12px 20px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    width: calc(100% - 32px);
}
.wcpc-combo-card .wcpc-add-combo-to-cart:hover {
    background: #444;
}

/* --- Single Combo Detail --- */
.wcpc-combo-detail {
    margin: 20px 0 40px;
}
/* --- Combo Gallery (single page) --- */
.wcpc-combo-gallery {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
}

/* Vertical thumbnail strip on the left */
.wcpc-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 118px;
    width: 118px;
    max-height: 620px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scrollbar-width: thin;
}
.wcpc-gallery-thumbs::-webkit-scrollbar { width: 5px; }
.wcpc-gallery-thumbs::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.wcpc-gallery-thumb {
    display: block;
    width: 100%;
    padding: 0;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #faf6ef;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.85;
}
.wcpc-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wcpc-gallery-thumb:hover { opacity: 1; border-color: #ddd; }
.wcpc-gallery-thumb.active { opacity: 1; border-color: #222; }

/* Main image on the right */
.wcpc-gallery-main {
    position: relative;
    flex: 1;
    min-width: 0;
    background: #faf6ef;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1;
}
.wcpc-gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wcpc-gallery-main .wcpc-combo-badge {
    top: 16px;
    left: 16px;
}

@media (max-width: 600px) {
    .wcpc-combo-gallery {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .wcpc-gallery-thumbs {
        flex-direction: row;
        width: 100%;
        flex: 0 0 auto;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }
    .wcpc-gallery-thumb {
        flex: 0 0 72px;
        width: 72px;
    }
}

.wcpc-combo-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
    flex-wrap: wrap;
}
.wcpc-combo-pricing {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.wcpc-mrp-price {
    font-size: 16px;
    color: #999;
}
.wcpc-sale-price {
    font-size: 24px;
    font-weight: 700;
    color: #222;
}
.wcpc-savings-tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.wcpc-combo-detail .wcpc-add-combo-to-cart {
    padding: 14px 32px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.wcpc-combo-detail .wcpc-add-combo-to-cart:hover {
    background: #444;
}

.wcpc-combo-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.wcpc-combo-product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.wcpc-combo-product-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.wcpc-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.wcpc-product-image {
    position: relative;
    background: #f7f7f7;
    aspect-ratio: 1;
}
.wcpc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wcpc-product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.wcpc-product-info {
    padding: 14px;
}
.wcpc-product-name {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 6px;
    color: #333;
    line-height: 1.3;
}
.wcpc-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wcpc-reg-price {
    font-size: 13px;
    color: #999;
}
.wcpc-current-price {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}


/* ===== Side Cart Drawer ===== */
.wcpc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.wcpc-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wcpc-side-cart {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 30px rgba(0,0,0,0.15);
}
.wcpc-side-cart.active {
    right: 0;
}

/* Header */
.wcpc-side-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.wcpc-cart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #222;
}
.wcpc-cart-count {
    background: #222;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.wcpc-close-cart {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}
.wcpc-close-cart:hover {
    color: #222;
    background: #f0f0f0;
}

/* Body */
.wcpc-side-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Savings Banner */
.wcpc-savings-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 20px 0;
    padding: 10px 14px;
    background: #e8f5e9;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
}
.wcpc-savings-banner svg {
    flex-shrink: 0;
    stroke: #2e7d32;
}

/* Cart Items */
.wcpc-cart-items {
    padding: 8px 0;
}

.wcpc-cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
}
.wcpc-cart-item:last-child {
    border-bottom: none;
}

.wcpc-item-image {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f7f7f7;
}
.wcpc-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wcpc-item-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.wcpc-item-details {
    flex: 1;
    min-width: 0;
}
.wcpc-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    margin: 0 0 2px;
    line-height: 1.3;
}
.wcpc-item-name a {
    color: inherit;
    text-decoration: none;
}
.wcpc-item-name a:hover {
    color: #666;
}

.wcpc-item-combo-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #e74c3c;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.wcpc-item-combo-tag a {
    color: inherit;
    text-decoration: none;
}
.wcpc-item-combo-tag a:hover {
    text-decoration: underline;
}

.wcpc-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.wcpc-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}
.wcpc-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.wcpc-qty-btn:hover {
    background: #eee;
}
.wcpc-qty-value {
    width: 32px;
    height: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    background: #fff;
    color: #222;
    -moz-appearance: textfield;
}
.wcpc-qty-value::-webkit-inner-spin-button,
.wcpc-qty-value::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcpc-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
}

.wcpc-remove-item {
    position: absolute;
    top: 10px;
    right: 16px;
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px;
    transition: color 0.2s;
}
.wcpc-remove-item:hover {
    color: #e74c3c;
}

/* Cross-sells */
.wcpc-cross-sells {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.wcpc-cross-sells-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin: 0 0 12px;
}
.wcpc-cross-sells-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.wcpc-cross-sell-item {
    flex: 0 0 120px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.wcpc-cross-sell-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wcpc-cross-sell-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.wcpc-cross-sell-info {
    padding: 8px 10px;
}
.wcpc-cross-sell-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wcpc-cross-sell-price {
    font-size: 12px;
    font-weight: 600;
    color: #222;
}
.wcpc-cross-sell-add {
    display: block;
    width: 100%;
    padding: 7px;
    background: #f5f5f5;
    color: #222;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}
.wcpc-cross-sell-add:hover {
    background: #e8e8e8;
}

/* Footer */
.wcpc-side-cart-footer {
    border-top: 1px solid #eee;
    padding: 16px 20px;
    flex-shrink: 0;
    background: #fff;
}

.wcpc-coupon-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.wcpc-coupon-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.wcpc-coupon-input:focus {
    border-color: #222;
}
.wcpc-apply-coupon {
    padding: 10px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    color: #222;
    white-space: nowrap;
}
.wcpc-apply-coupon:hover {
    background: #e8e8e8;
}

.wcpc-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}
.wcpc-subtotal-label {
    font-size: 15px;
    font-weight: 500;
    color: #444;
}
.wcpc-subtotal-amount {
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.wcpc-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}
.wcpc-checkout-btn:hover {
    background: #444;
    color: #fff;
}

.wcpc-view-cart-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 13px;
    text-decoration: underline;
}
.wcpc-view-cart-link:hover {
    color: #222;
}

/* Empty cart */
.wcpc-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
    flex: 1;
}
.wcpc-cart-empty svg {
    margin-bottom: 16px;
    stroke: #ccc;
}
.wcpc-cart-empty p {
    font-size: 15px;
    margin: 0;
}

/* Loading state */
.wcpc-add-combo-to-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
    .wcpc-side-cart {
        width: 100%;
        max-width: 100vw;
    }
    .wcpc-combo-summary {
        flex-direction: column;
        align-items: flex-start;
    }
    .wcpc-combo-detail .wcpc-add-combo-to-cart {
        width: 100%;
    }
}
