/* ============================================
   Shop Manager By NguyenNguyen - Public Styles
   ============================================ */

/* ============================================
   Product Grid & Cards
   ============================================ */

.shop-products-container {
    margin: 30px 0;
}

.shop-products-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

/* Columns layout */
.shop-products-container.columns-2 .shop-products-grid {
    grid-template-columns: repeat(2, 1fr);
}

.shop-products-container.columns-3 .shop-products-grid {
    grid-template-columns: repeat(3, 1fr);
}

.shop-products-container.columns-4 .shop-products-grid {
    grid-template-columns: repeat(4, 1fr);
}

.shop-products-container.columns-5 .shop-products-grid {
    grid-template-columns: repeat(5, 1fr);
}

/* Product Card */
.product-item {
    position: relative;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

/* Product Image */
.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.product-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 14px;
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    z-index: 2;
}

/* Product Content */
.product-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 50px;
}

.product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a:hover {
    color: #667eea;
}

.product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin-bottom: 15px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.price-amount {
    font-size: 22px;
    font-weight: 700;
    color: #d32f2f;
    display: inline-block;
}

.price-contact {
    font-size: 16px;
    color: #999;
    font-style: italic;
    font-weight: 600;
}

/* ============================================
   Product Action Buttons
   ============================================ */

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.product-actions .btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* Add to Cart Button */
.btn-add-to-cart {
    background: #fff;
    color: #ef6706;
    border: 2px solid #ef6706;
    cursor: pointer;
    line-height: 1.5;
    text-decoration: none;
    border-radius: 12px;
    padding: 10px 20px;
}

@media (max-width: 768px) {
    .btn-add-to-cart {
        border: 1px solid #ef6706;
        font-size: 12px;
        padding: 8px;
    }

    .btn-buy-now {
        font-size: 12px;
        padding: 8px !important;
    }
}

.btn-add-to-cart:hover {
    background: #ef6706;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 103, 6, 0.3);
}

.btn-add-to-cart:active {
    transform: translateY(0);
}

/* Buy Now Button */
.btn-buy-now {
    background: #ef6706;
    color: white;
    border: 2px solid #ef6706;
    cursor: pointer;
    line-height: 1.5;
    text-decoration: none;
    border-radius: 12px;
    padding: 10px 20px;
}

.btn-buy-now:hover {
    background: #d85a05;
    border-color: #d85a05;
    box-shadow: 0 4px 12px rgba(239, 103, 6, 0.4);
}

.btn-buy-now:active {
    transform: translateY(0);
}

/* Button States */
.btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
    cursor: wait;
}

.btn.added {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: #fff !important;
}

.btn .btn-icon {
    font-size: 18px;
    line-height: 1;
}

.btn .btn-text {
    line-height: 1;
}

.btn .loading-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(239, 103, 6, 0.3);
    border-radius: 50%;
    border-top-color: #ef6706;
    animation: spin 0.8s linear infinite;
}

.btn.loading .loading-spinner {
    display: inline-block;
    border-top-color: currentColor;
}

.btn.loading .btn-text,
.btn.loading .btn-icon {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ============================================
   Toast Notification
   ============================================ */

.shop-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 320px;
    max-width: 500px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #2196F3;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.shop-toast.show {
    transform: translateX(0);
}

.shop-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e3f2fd;
    color: #2196F3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.shop-toast-content {
    flex: 1;
}

.shop-toast-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.shop-toast-message {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.shop-toast-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}

.shop-toast-close:hover {
    color: #333;
}

/* ============================================
   Cart Page
   ============================================ */

.shop-cart-page {
    /*max-width: 1200px;*/
    /*margin: 40px auto;*/
    /*padding: 30px;*/
    /*background: white;*/
    /*border-radius: 12px;*/
    /*box-shadow: 0 4px 12px rgba(0,0,0,0.1);*/
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
}

/*.cart-empty p:first-child {*/
/*    font-size: 48px;*/
/*    margin-bottom: 20px;*/
/*}*/

.cart-items {
    margin-top: 30px;
}

.shop-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.shop-cart-table thead {
    background: #f5f5f5;
}

.shop-cart-table th,
.shop-cart-table td {
    padding: 5px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.shop-cart-table th {
    font-weight: 600;
    color: #333;
}

.product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-quantity-input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
}

.btn-remove-item {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #d32f2f;
}

.shop-cart-table tfoot td {
    font-size: 20px;
    padding: 20px 15px;
    border-top: 2px solid #333;
}

.cart-total-amount {
    color: #d32f2f;
    font-size: 20px;
    font-weight: 700;
}

.cart-actions {
    text-align: right;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-actions .checkout-btn{
    background: #ef6706;
    text-align: center;
}

.cart-actions .checkout-btn:hover{
    background: rgba(239, 103, 6, 0.82);
}

.button {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button-primary {
    background: #ef6706;
    color: white;
}

.button-primary:hover {
    background: #d85a05;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ============================================
   Checkout Page
   ============================================ */

.shop-checkout-page {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.checkout-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.checkout-billing,
.checkout-order {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ef6706;
}

.form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.required {
    color: #d32f2f;
}

.shop-order-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.shop-order-table thead {
    background: #f5f5f5;
}

.shop-order-table th,
.shop-order-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.shop-order-table tfoot {
    border-top: 2px solid #333;
}

.checkout-total-amount {
    color: #d32f2f;
    font-size: 18px;
    font-weight: 700;
}

.payment-method {
    margin: 20px 0;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: #ef6706;
    background: #fff5f0;
}

.payment-option input[type="radio"] {
    width: auto;
    margin-right: 15px;
}

.button-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1200px) {
    .shop-products-container.columns-5 .shop-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .shop-products-container.columns-4 .shop-products-grid,
    .shop-products-container.columns-5 .shop-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .checkout-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .shop-products-container.columns-3 .shop-products-grid,
    .shop-products-container.columns-4 .shop-products-grid,
    .shop-products-container.columns-5 .shop-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-products-grid {
        gap: 20px;
    }

    .product-content {
        padding: 15px;
    }

    .product-title {
        font-size: 16px;
        min-height: auto;
    }

    .product-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .price-amount {
        font-size: 18px;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
        font-size: 18px;
    }

    .shop-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .shop-cart-table {
        font-size: 12px;
    }

    .product-thumbnail img {
        width: 60px;
        height: 60px;
    }

    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }

    .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .shop-products-container.columns-2 .shop-products-grid,
    .shop-products-container.columns-3 .shop-products-grid,
    .shop-products-container.columns-4 .shop-products-grid,
    .shop-products-container.columns-5 .shop-products-grid {
        grid-template-columns: 1fr;
    }

    .shop-products-grid {
        gap: 15px;
    }

    .product-badge {
        font-size: 11px;
        padding: 4px 10px;
        top: 8px;
        right: 8px;
    }

    .product-title {
        font-size: 15px;
    }

    .price-amount {
        font-size: 16px;
    }

    .product-actions .btn {
        padding: 10px 14px;
        font-size: 16px;
    }
}

/* ===================================
   LOADING OVERLAY
   =================================== */
/* ✅ Loading Overlay */
.shop-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.shop-loading-spinner {
    text-align: center;
    color: white;
}

.shop-loading-spinner .spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.shop-loading-spinner p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   MODAL BASE
   =================================== */
.shop-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    display: none;
}

.shop-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: none;
}

.shop-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.shop-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.shop-modal-header.success {
    background: linear-gradient(135deg, #00a32a 0%, #00ba37 100%);
    color: white;
    text-align: center;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: white;
    color: #00a32a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    margin: 0 auto 15px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #d63638;
}

.shop-modal-header.success .modal-close {
    color: white;
}

.shop-modal-body {
    padding: 30px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.shop-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ===================================
   BANK TRANSFER MODAL
   =================================== */
.qr-code-container {
    text-align: center;
    margin-bottom: 30px;
}

.bank-qr-code {
    max-width: 300px;
    width: 100%;
    height: auto;
    border: 3px solid #0073aa;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.qr-hint {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.bank-details {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bank-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.bank-detail-item:last-child {
    border-bottom: none;
}

.bank-detail-item label {
    font-weight: 600;
    color: #666;
    min-width: 140px;
}

.bank-detail-item strong {
    font-size: 16px;
    color: #333;
}

.bank-detail-item .amount {
    color: #d63638;
    font-size: 20px;
}

.copyable {
    cursor: pointer;
    position: relative;
    padding-right: 30px;
    transition: color 0.2s;
}

.copyable:hover {
    color: #2271b1;
}

.copy-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.bank-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.bank-note p {
    margin: 0 0 10px;
    color: #856404;
}

.bank-note ul {
    margin: 0;
    padding-left: 20px;
}

.bank-note li {
    color: #856404;
    margin-bottom: 5px;
}

/* ===================================
   SUCCESS MODAL
   =================================== */
.thank-you-message {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.order-info-item.full-width {
    grid-column: 1 / -1;
}

.order-info-item label {
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.order-info-item strong,
.order-info-item span {
    font-size: 15px;
    color: #333;
}

.order-items {
    margin-bottom: 25px;
}

.order-items h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table thead {
    background: #f0f0f0;
}

.items-table th,
.items-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.items-table th {
    font-weight: 600;
    color: #333;
}

.items-table .text-center {
    text-align: center;
}

.items-table .text-right {
    text-align: right;
}

.items-table tfoot th {
    background: #2271b1;
    color: white;
    font-size: 16px;
}

.total-amount {
    color: #ffd700 !important;
    font-size: 18px !important;
}

.next-steps {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #2271b1;
}

.next-steps p {
    margin: 8px 0;
    color: #0c5ba0;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #2271b1;
    color: white;
}

.btn-primary:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .cart-quantity-input{
        width: 50px;
    }

    .shop-modal {
        width: 95%;
        max-height: 95vh;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .shop-modal-footer {
        flex-direction: column;
    }

    .shop-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .items-table {
        font-size: 13px;
    }

    .items-table th,
    .items-table td {
        padding: 8px;
    }

    .shop-cart-table tfoot td{
        font-size: 16px;
        padding: 10px 10px;
    }

    .shop-cart-table {
        margin: 16px 0;
    }

    .btn-remove-item{
        font-size: 14px;
        padding: 10px;
    }

    .cart-total-amount{
        font-size: 16px;
    }
}