/**
 * Kunaki Shop Frontend Styles
 */

/* Product Type Badge */
.kunaki-product-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.kunaki-type-cd {
    background: #4CAF50;
    color: #fff;
}

.kunaki-type-vinyl {
    background: #9C27B0;
    color: #fff;
}

.kunaki-type-cassette {
    background: #FF9800;
    color: #fff;
}

.kunaki-type-dvd {
    background: #2196F3;
    color: #fff;
}

.kunaki-type-bluray {
    background: #00BCD4;
    color: #fff;
}

/* Product Grid */
.kunaki-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.kunaki-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #fff;
}

.kunaki-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.kunaki-product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kunaki-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.kunaki-product-info {
    padding: 20px;
}

.kunaki-product-title {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.kunaki-product-title a {
    text-decoration: none;
    color: #333;
}

.kunaki-product-title a:hover {
    color: #0073aa;
}

.kunaki-product-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.kunaki-product-price {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 15px;
}

.kunaki-add-to-cart-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background 0.3s;
}

.kunaki-add-to-cart-btn:hover {
    background: #005a87;
}

.kunaki-out-of-stock {
    color: #a00;
    font-weight: bold;
}

/* Single Product */
.kunaki-single-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 30px 0;
}

.kunaki-product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kunaki-main-image {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.kunaki-main-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.kunaki-thumbnail-images {
    display: flex;
    gap: 10px;
}

.kunaki-thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    object-fit: contain;
    background: #f5f5f5;
    padding: 5px;
}

.kunaki-thumbnail:hover {
    border-color: #0073aa;
}

.kunaki-add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.kunaki-quantity-input {
    width: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Cart */
.kunaki-cart {
    margin: 30px 0;
}

.kunaki-cart h2 {
    margin-bottom: 20px;
}

.kunaki-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.kunaki-cart-table th,
.kunaki-cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.kunaki-cart-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.kunaki-cart-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.kunaki-cart-product img {
    border-radius: 4px;
}

.kunaki-cart-quantity {
    width: 70px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.kunaki-remove-item {
    background: #dc3232;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.kunaki-remove-item:hover {
    background: #a00;
}

.kunaki-cart-actions {
    text-align: right;
}

.kunaki-checkout-btn {
    background: #0073aa;
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    font-size: 18px;
}

.kunaki-checkout-btn:hover {
    background: #005a87;
}

/* Checkout */
.kunaki-checkout {
    margin: 30px 0;
    max-width: 800px;
}

.kunaki-checkout h2 {
    margin-bottom: 30px;
}

.kunaki-checkout-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.kunaki-checkout-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.kunaki-form-row {
    margin-bottom: 20px;
}

.kunaki-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.kunaki-form-row input[type="text"],
.kunaki-form-row input[type="email"],
.kunaki-form-row select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.kunaki-btn-secondary {
    background: #555;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.kunaki-btn-secondary:hover {
    background: #333;
}

.kunaki-shipping-option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.kunaki-shipping-option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.kunaki-shipping-option input[type="radio"] {
    margin-right: 10px;
}

.kunaki-order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.kunaki-order-total {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    font-size: 20px;
}

.kunaki-checkout-submit {
    background: #46b450;
    color: #fff;
    border: none;
    padding: 18px 40px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    width: 100%;
}

.kunaki-checkout-submit:hover {
    background: #2ea02e;
}

/* Payment Methods */
.kunaki-payment-methods {
    margin: 20px 0;
}

.kunaki-payment-method {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.kunaki-payment-method:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.kunaki-payment-method input[type="radio"] {
    margin-right: 10px;
}

.kunaki-payment-details {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

#card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

#card-errors {
    color: #dc3232;
    margin-top: 10px;
    font-size: 14px;
}

#paypal-button-container {
    margin-top: 15px;
}

/* Responsive Design - Mobile First */

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
    .kunaki-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }
    
    .kunaki-product-card {
        max-width: 100%;
    }
    
    .kunaki-product-image {
        height: 200px;
    }
    
    .kunaki-product-info {
        padding: 15px;
    }
    
    .kunaki-product-title {
        font-size: 16px;
    }
    
    .kunaki-product-price {
        font-size: 20px;
    }
    
    .kunaki-add-to-cart-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Single Product Mobile */
    .kunaki-single-product {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .kunaki-main-image {
        min-height: 250px;
    }
    
    .kunaki-main-image img {
        max-height: 250px;
    }
    
    .kunaki-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .kunaki-add-to-cart-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kunaki-quantity-input {
        width: 100%;
    }
    
    /* Cart Mobile */
    .kunaki-cart {
        padding: 0 15px;
    }
    
    .kunaki-cart-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .kunaki-cart-table thead {
        display: none;
    }
    
    .kunaki-cart-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
    }
    
    .kunaki-cart-table td {
        display: block;
        text-align: right;
        padding: 8px 0;
        border: none;
    }
    
    .kunaki-cart-table td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }
    
    .kunaki-cart-product {
        flex-direction: column;
        text-align: left;
    }
    
    .kunaki-cart-product img {
        width: 100%;
        max-width: 150px;
    }
    
    .kunaki-cart-quantity {
        width: 100%;
        max-width: 100px;
    }
    
    .kunaki-remove-item {
        width: 100%;
        margin-top: 10px;
    }
    
    .kunaki-cart-actions {
        text-align: center;
    }
    
    .kunaki-checkout-btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
    
    /* Checkout Mobile */
    .kunaki-checkout {
        padding: 0 15px;
        max-width: 100%;
    }
    
    .kunaki-checkout h2 {
        font-size: 24px;
    }
    
    .kunaki-checkout-section {
        padding: 15px;
    }
    
    .kunaki-checkout-section h3 {
        font-size: 18px;
    }
    
    .kunaki-form-row input[type="text"],
    .kunaki-form-row input[type="email"],
    .kunaki-form-row select {
        font-size: 16px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .kunaki-shipping-option {
        padding: 12px;
    }
    
    .kunaki-order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .kunaki-order-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        font-size: 18px;
    }
    
    .kunaki-checkout-submit {
        padding: 15px 30px;
        font-size: 18px;
    }
    
    /* Payment Methods Mobile */
    .kunaki-payment-method {
        padding: 12px;
    }
    
    .kunaki-payment-details {
        padding: 15px;
    }
    
    /* Full Shop Mobile */
    .kunaki-shop-header {
        padding: 20px 15px;
    }
    
    .kunaki-shop-header h2 {
        font-size: 22px;
    }
    
    .kunaki-shop-product {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .kunaki-product-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .kunaki-product-images-section {
        order: 1;
    }
    
    .kunaki-product-details-section {
        order: 2;
    }
    
    .kunaki-main-product-image img {
        max-width: 100%;
    }
    
    .kunaki-product-thumbnails {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .kunaki-product-thumbnails img {
        width: 70px;
        height: 70px;
    }
    
    .kunaki-product-name {
        font-size: 20px;
    }
    
    .kunaki-product-info-table {
        font-size: 14px;
    }
    
    .kunaki-product-info-table th {
        width: 120px;
        padding: 8px;
    }
    
    .kunaki-product-info-table td {
        padding: 8px;
    }
    
    .kunaki-product-barcode-section {
        padding: 15px;
    }
    
    .kunaki-barcode-display img {
        max-width: 100%;
    }
    
    .kunaki-product-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .kunaki-quantity-selector {
        width: 100%;
    }
    
    .kunaki-qty-input {
        width: 100%;
    }
    
    .kunaki-btn-primary,
    .kunaki-btn-secondary {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }
}

/* Tablet Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .kunaki-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 20px;
    }
    
    .kunaki-single-product {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }
    
    .kunaki-cart {
        padding: 0 20px;
    }
    
    .kunaki-cart-table {
        font-size: 14px;
    }
    
    .kunaki-cart-table th,
    .kunaki-cart-table td {
        padding: 10px;
    }
    
    .kunaki-checkout {
        padding: 0 20px;
    }
    
    .kunaki-product-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Large Tablet / Small Desktop (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .kunaki-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .kunaki-single-product {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .kunaki-product-row {
        grid-template-columns: 1fr 1.5fr;
        gap: 30px;
    }
}

/* Touch-Friendly Enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .kunaki-add-to-cart-btn,
    .kunaki-checkout-btn,
    .kunaki-btn-secondary,
    .kunaki-remove-item,
    .kunaki-checkout-submit {
        min-height: 44px;
        padding: 14px 24px;
    }
    
    .kunaki-thumbnail {
        min-width: 70px;
        min-height: 70px;
    }
    
    input[type="radio"],
    input[type="checkbox"] {
        min-width: 24px;
        min-height: 24px;
    }
    
    .kunaki-form-row input,
    .kunaki-form-row select {
        min-height: 48px;
    }
    
    .kunaki-shipping-option,
    .kunaki-payment-method {
        min-height: 60px;
    }
}

/* Print Styles */
@media print {
    .kunaki-add-to-cart-btn,
    .kunaki-checkout-btn,
    .kunaki-btn-secondary,
    .kunaki-remove-item {
        display: none;
    }
    
    .kunaki-cart-table {
        border: 1px solid #000;
    }
    
    .kunaki-product-card {
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
.kunaki-add-to-cart-btn:focus,
.kunaki-checkout-btn:focus,
.kunaki-checkout-submit:focus,
.kunaki-btn-secondary:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .kunaki-product-card {
        border: 2px solid #000;
    }
    
    .kunaki-add-to-cart-btn {
        border: 2px solid #fff;
    }
}

/* Loading States */
.kunaki-loading {
    opacity: 0.6;
    pointer-events: none;
}

.kunaki-message {
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.kunaki-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.kunaki-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}
